| 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 .csv suffix or ?format=csv
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: text/csv
Content-Type: text/csv
Content-Length: length
{"saleId":0,"saleRepresentativeEmails":["String"],"promoterTypeId":"String","saleItems":[{"saleDetailId":0,"unitPrice":0,"currencyCode":"String"}]}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{}