GET, POST | /api/GiftCard |
---|
import 'package:servicestack/servicestack.dart';
// @DataContract
class BaseRequest implements IConvertible
{
/**
* This is your AIM API Key provided by Tri-Tech
*/
// @DataMember
// @ApiMember(DataType="string", Description="This is your AIM API Key provided by Tri-Tech", IsRequired=true, Name="ApiKey", ParameterType="header")
String? ApiKey;
// @DataMember
// @ApiMember(DataType="string", Name="OAuthToken", ParameterType="header")
String? OAuthToken;
BaseRequest({this.ApiKey,this.OAuthToken});
BaseRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ApiKey = json['ApiKey'];
OAuthToken = json['OAuthToken'];
return this;
}
Map<String, dynamic> toJson() => {
'ApiKey': ApiKey,
'OAuthToken': OAuthToken
};
getTypeName() => "BaseRequest";
TypeContext? context = _ctx;
}
// @DataContract
class BaseResponseResult implements IConvertible
{
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")
String? StatusCode;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")
String? Login;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")
String? ErrorCode;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")
String? ErrorDisplayText;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")
String? ErrorMessage;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")
String? DomainName;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")
String? IpAddress;
BaseResponseResult({this.StatusCode,this.Login,this.ErrorCode,this.ErrorDisplayText,this.ErrorMessage,this.DomainName,this.IpAddress});
BaseResponseResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
StatusCode = json['StatusCode'];
Login = json['Login'];
ErrorCode = json['ErrorCode'];
ErrorDisplayText = json['ErrorDisplayText'];
ErrorMessage = json['ErrorMessage'];
DomainName = json['DomainName'];
IpAddress = json['IpAddress'];
return this;
}
Map<String, dynamic> toJson() => {
'StatusCode': StatusCode,
'Login': Login,
'ErrorCode': ErrorCode,
'ErrorDisplayText': ErrorDisplayText,
'ErrorMessage': ErrorMessage,
'DomainName': DomainName,
'IpAddress': IpAddress
};
getTypeName() => "BaseResponseResult";
TypeContext? context = _ctx;
}
// @DataContract
class BaseResponse implements IConvertible
{
/**
*
*/
// @DataMember
// @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")
BaseResponseResult? Status;
BaseResponse({this.Status});
BaseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Status = JsonConverters.fromJson(json['Status'],'BaseResponseResult',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Status': JsonConverters.toJson(Status,'BaseResponseResult',context!)
};
getTypeName() => "BaseResponse";
TypeContext? context = _ctx;
}
// @DataContract
class GiftCardResponse extends BaseResponse implements IConvertible
{
// @DataMember
double? Balance;
GiftCardResponse({this.Balance});
GiftCardResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
Balance = JsonConverters.toDouble(json['Balance']);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'Balance': Balance
});
getTypeName() => "GiftCardResponse";
TypeContext? context = _ctx;
}
/**
* GiftCardRequires active-e 3rd Party E-Commerce or active-e Vortx E-Commerce.
*/
// @DataContract
class GiftCardRequest extends BaseRequest implements IConvertible
{
// @DataMember
String? GiftCard;
// @DataMember
String? PIN;
// @DataMember
String? WebRef;
// @DataMember
double? ChargeAmount;
GiftCardRequest({this.GiftCard,this.PIN,this.WebRef,this.ChargeAmount});
GiftCardRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
GiftCard = json['GiftCard'];
PIN = json['PIN'];
WebRef = json['WebRef'];
ChargeAmount = JsonConverters.toDouble(json['ChargeAmount']);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'GiftCard': GiftCard,
'PIN': PIN,
'WebRef': WebRef,
'ChargeAmount': ChargeAmount
});
getTypeName() => "GiftCardRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'active_ewebservice.biz', types: <String, TypeInfo> {
'BaseRequest': TypeInfo(TypeOf.Class, create:() => BaseRequest()),
'BaseResponseResult': TypeInfo(TypeOf.Class, create:() => BaseResponseResult()),
'BaseResponse': TypeInfo(TypeOf.Class, create:() => BaseResponse()),
'GiftCardResponse': TypeInfo(TypeOf.Class, create:() => GiftCardResponse()),
'GiftCardRequest': TypeInfo(TypeOf.Class, create:() => GiftCardRequest()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/GiftCard HTTP/1.1
Host: active-ewebservice.biz
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"GiftCard":"String","PIN":"String","WebRef":"String","ChargeAmount":0,"ApiKey":"String","OAuthToken":"String"}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"Balance":0,"Status":{"StatusCode":"String","Login":"String","ErrorCode":"String","ErrorDisplayText":"String","ErrorMessage":"String","DomainName":"String","IpAddress":"String"}}