| Requires any of the roles: | Admin, TeamAdmin | Requires the permission: | ReadData |
| POST | /GiftCard/Search |
|---|
import 'package:servicestack/servicestack.dart';
class GiftCardSummary implements IConvertible
{
int? id;
int? giftCardTypeId;
String? codeLast4;
String? scope;
int? scopeOwnerId;
String? currency;
int? initialValueMinor;
int? currentBalanceMinor;
String? status;
DateTime? activatedAt;
DateTime? expiresAt;
DateTime? createdAt;
String? buyerName;
String? buyerEmail;
String? buyerPhone;
String? paymentId;
String? paymentMethodId;
String? purchasePaymentReference;
GiftCardSummary({this.id,this.giftCardTypeId,this.codeLast4,this.scope,this.scopeOwnerId,this.currency,this.initialValueMinor,this.currentBalanceMinor,this.status,this.activatedAt,this.expiresAt,this.createdAt,this.buyerName,this.buyerEmail,this.buyerPhone,this.paymentId,this.paymentMethodId,this.purchasePaymentReference});
GiftCardSummary.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
giftCardTypeId = json['giftCardTypeId'];
codeLast4 = json['codeLast4'];
scope = json['scope'];
scopeOwnerId = json['scopeOwnerId'];
currency = json['currency'];
initialValueMinor = json['initialValueMinor'];
currentBalanceMinor = json['currentBalanceMinor'];
status = json['status'];
activatedAt = JsonConverters.fromJson(json['activatedAt'],'DateTime',context!);
expiresAt = JsonConverters.fromJson(json['expiresAt'],'DateTime',context!);
createdAt = JsonConverters.fromJson(json['createdAt'],'DateTime',context!);
buyerName = json['buyerName'];
buyerEmail = json['buyerEmail'];
buyerPhone = json['buyerPhone'];
paymentId = json['paymentId'];
paymentMethodId = json['paymentMethodId'];
purchasePaymentReference = json['purchasePaymentReference'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'giftCardTypeId': giftCardTypeId,
'codeLast4': codeLast4,
'scope': scope,
'scopeOwnerId': scopeOwnerId,
'currency': currency,
'initialValueMinor': initialValueMinor,
'currentBalanceMinor': currentBalanceMinor,
'status': status,
'activatedAt': JsonConverters.toJson(activatedAt,'DateTime',context!),
'expiresAt': JsonConverters.toJson(expiresAt,'DateTime',context!),
'createdAt': JsonConverters.toJson(createdAt,'DateTime',context!),
'buyerName': buyerName,
'buyerEmail': buyerEmail,
'buyerPhone': buyerPhone,
'paymentId': paymentId,
'paymentMethodId': paymentMethodId,
'purchasePaymentReference': purchasePaymentReference
};
getTypeName() => "GiftCardSummary";
TypeContext? context = _ctx;
}
class GiftCardSearchResult implements IConvertible
{
List<GiftCardSummary>? items;
int? statusCode;
String? message;
GiftCardSearchResult({this.items,this.statusCode,this.message});
GiftCardSearchResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
items = JsonConverters.fromJson(json['items'],'List<GiftCardSummary>',context!);
statusCode = json['statusCode'];
message = json['message'];
return this;
}
Map<String, dynamic> toJson() => {
'items': JsonConverters.toJson(items,'List<GiftCardSummary>',context!),
'statusCode': statusCode,
'message': message
};
getTypeName() => "GiftCardSearchResult";
TypeContext? context = _ctx;
}
class GiftCardSearchRequest implements IConvertible
{
int? giftCardTypeId;
String? scope;
int? ownerId;
String? status;
String? codeLast4;
GiftCardSearchRequest({this.giftCardTypeId,this.scope,this.ownerId,this.status,this.codeLast4});
GiftCardSearchRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
giftCardTypeId = json['giftCardTypeId'];
scope = json['scope'];
ownerId = json['ownerId'];
status = json['status'];
codeLast4 = json['codeLast4'];
return this;
}
Map<String, dynamic> toJson() => {
'giftCardTypeId': giftCardTypeId,
'scope': scope,
'ownerId': ownerId,
'status': status,
'codeLast4': codeLast4
};
getTypeName() => "GiftCardSearchRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
'GiftCardSummary': TypeInfo(TypeOf.Class, create:() => GiftCardSummary()),
'GiftCardSearchResult': TypeInfo(TypeOf.Class, create:() => GiftCardSearchResult()),
'List<GiftCardSummary>': TypeInfo(TypeOf.Class, create:() => <GiftCardSummary>[]),
'GiftCardSearchRequest': TypeInfo(TypeOf.Class, create:() => GiftCardSearchRequest()),
});
Dart GiftCardSearchRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /GiftCard/Search HTTP/1.1
Host: stubbur-app.azurewebsites.net
Accept: application/json
Content-Type: application/json
Content-Length: length
{"giftCardTypeId":0,"scope":"String","ownerId":0,"status":"String","codeLast4":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"items":[{"id":0,"giftCardTypeId":0,"codeLast4":"String","scope":"String","scopeOwnerId":0,"currency":"String","initialValueMinor":0,"currentBalanceMinor":0,"status":"String","activatedAt":"0001-01-01T00:00:00.0000000","expiresAt":"0001-01-01T00:00:00.0000000","createdAt":"0001-01-01T00:00:00.0000000","buyerName":"String","buyerEmail":"String","buyerPhone":"String","paymentId":"String","paymentMethodId":"String","purchasePaymentReference":"String"}],"statusCode":0,"message":"String"}