| PATCH | /warranty/{saleId} | Patch Sellout | Patch Sellout with Updated info |
|---|
import 'package:servicestack/servicestack.dart';
class PatchSelloutResponse implements IConvertible
{
PatchSelloutResponse();
PatchSelloutResponse.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "PatchSelloutResponse";
TypeContext? context = _ctx;
}
class SaleItem implements IConvertible
{
/**
* Unique Identifier of the Sell-out item created in Booster
*/
// @ApiMember(Description="Unique Identifier of the Sell-out item created in Booster", IsRequired=true)
int saleDetailId = 0;
/**
* Sold Price to the end-client
*/
// @ApiMember(Description="Sold Price to the end-client")
double? unitPrice;
/**
* Currency of the sold price to the end-client
*/
// @ApiMember(Description="Currency of the sold price to the end-client")
String? currencyCode;
SaleItem({this.saleDetailId=0,this.unitPrice,this.currencyCode});
SaleItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
saleDetailId = json['saleDetailId'] ?? 0;
unitPrice = JsonConverters.toDouble(json['unitPrice']);
currencyCode = json['currencyCode'];
return this;
}
Map<String, dynamic> toJson() => {
'saleDetailId': saleDetailId,
'unitPrice': unitPrice,
'currencyCode': currencyCode
};
getTypeName() => "SaleItem";
TypeContext? context = _ctx;
}
class PatchSellout implements IConvertible
{
/**
* Unique Identifier of the Sell-out created in Booster
*/
// @ApiMember(Description="Unique Identifier of the Sell-out created in Booster", IsRequired=true)
int saleId = 0;
/**
* Emails of Sale Representatives
*/
// @ApiMember(Description="Emails of Sale Representatives")
List<String>? saleRepresentativeEmails;
/**
* Promoter Type ID
*/
// @ApiMember(Description="Promoter Type ID")
String? promoterTypeId;
/**
* Items list of the sale
*/
// @ApiMember(Description="Items list of the sale")
List<SaleItem>? saleItems;
PatchSellout({this.saleId=0,this.saleRepresentativeEmails,this.promoterTypeId,this.saleItems});
PatchSellout.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
saleId = json['saleId'] ?? 0;
saleRepresentativeEmails = JsonConverters.fromJson(json['saleRepresentativeEmails'],'List<String>',context!);
promoterTypeId = json['promoterTypeId'];
saleItems = JsonConverters.fromJson(json['saleItems'],'List<SaleItem>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'saleId': saleId,
'saleRepresentativeEmails': JsonConverters.toJson(saleRepresentativeEmails,'List<String>',context!),
'promoterTypeId': promoterTypeId,
'saleItems': JsonConverters.toJson(saleItems,'List<SaleItem>',context!)
};
getTypeName() => "PatchSellout";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev_api_booster.richemont.com', types: <String, TypeInfo> {
'PatchSelloutResponse': TypeInfo(TypeOf.Class, create:() => PatchSelloutResponse()),
'SaleItem': TypeInfo(TypeOf.Class, create:() => SaleItem()),
'PatchSellout': TypeInfo(TypeOf.Class, create:() => PatchSellout()),
'List<SaleItem>': TypeInfo(TypeOf.Class, create:() => <SaleItem>[]),
});
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.
PATCH /warranty/{saleId} HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<PatchSellout xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Sellout.ServiceModel">
<promoterTypeId>String</promoterTypeId>
<saleId>0</saleId>
<saleItems>
<SaleItem>
<currencyCode>String</currencyCode>
<saleDetailId>0</saleDetailId>
<unitPrice>0</unitPrice>
</SaleItem>
</saleItems>
<saleRepresentativeEmails xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</saleRepresentativeEmails>
</PatchSellout>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <PatchSelloutResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Sellout.ServiceModel" />