| 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 .xml suffix or ?format=xml
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/xml
Content-Type: application/xml
Content-Length: length
<GiftCardSearchRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<CodeLast4>String</CodeLast4>
<GiftCardTypeId>0</GiftCardTypeId>
<OwnerId>0</OwnerId>
<Scope>String</Scope>
<Status>String</Status>
</GiftCardSearchRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GiftCardSearchResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<Items>
<GiftCardSummary>
<ActivatedAt>0001-01-01T00:00:00</ActivatedAt>
<BuyerEmail>String</BuyerEmail>
<BuyerName>String</BuyerName>
<BuyerPhone>String</BuyerPhone>
<CodeLast4>String</CodeLast4>
<CreatedAt>0001-01-01T00:00:00</CreatedAt>
<Currency>String</Currency>
<CurrentBalanceMinor>0</CurrentBalanceMinor>
<ExpiresAt>0001-01-01T00:00:00</ExpiresAt>
<GiftCardTypeId>0</GiftCardTypeId>
<ID>0</ID>
<InitialValueMinor>0</InitialValueMinor>
<PaymentId>String</PaymentId>
<PaymentMethodId>String</PaymentMethodId>
<PurchasePaymentReference>String</PurchasePaymentReference>
<Scope>String</Scope>
<ScopeOwnerId>0</ScopeOwnerId>
<Status>String</Status>
</GiftCardSummary>
</Items>
<Message>String</Message>
<StatusCode>0</StatusCode>
</GiftCardSearchResult>