POST | /v1/product-matching-update-callback |
---|
import 'package:servicestack/servicestack.dart';
// @DataContract
class ProductMatch implements IProductMatch, IConvertible
{
// @DataMember(Name="retailerGuid")
String? retailerGuid;
// @DataMember(Name="retailerName")
String? retailerName;
// @DataMember(Name="brand")
String? brand;
// @DataMember(Name="productName")
String? productName;
// @DataMember(Name="description")
String? description;
// @DataMember(Name="sku")
String? sku;
// @DataMember(Name="gtin")
String? gtin;
// @DataMember(Name="ean8")
String? eaN8;
// @DataMember(Name="ean13")
String? eaN13;
// @DataMember(Name="isbn")
String? isbn;
// @DataMember(Name="upc")
String? upc;
// @DataMember(Name="productImageUrl")
Uri? productImageUrl;
// @DataMember(Name="productUrl")
Uri? productUrl;
// @DataMember(Name="auditResult")
String? auditResult;
// @DataMember(Name="auditResultReasons")
List<String>? auditResultReasons;
ProductMatch({this.retailerGuid,this.retailerName,this.brand,this.productName,this.description,this.sku,this.gtin,this.eaN8,this.eaN13,this.isbn,this.upc,this.productImageUrl,this.productUrl,this.auditResult,this.auditResultReasons});
ProductMatch.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
retailerGuid = json['retailerGuid'];
retailerName = json['retailerName'];
brand = json['brand'];
productName = json['productName'];
description = json['description'];
sku = json['sku'];
gtin = json['gtin'];
eaN8 = json['eaN8'];
eaN13 = json['eaN13'];
isbn = json['isbn'];
upc = json['upc'];
productImageUrl = JsonConverters.fromJson(json['productImageUrl'],'Uri',context!);
productUrl = JsonConverters.fromJson(json['productUrl'],'Uri',context!);
auditResult = json['auditResult'];
auditResultReasons = JsonConverters.fromJson(json['auditResultReasons'],'List<String>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'retailerGuid': retailerGuid,
'retailerName': retailerName,
'brand': brand,
'productName': productName,
'description': description,
'sku': sku,
'gtin': gtin,
'eaN8': eaN8,
'eaN13': eaN13,
'isbn': isbn,
'upc': upc,
'productImageUrl': JsonConverters.toJson(productImageUrl,'Uri',context!),
'productUrl': JsonConverters.toJson(productUrl,'Uri',context!),
'auditResult': auditResult,
'auditResultReasons': JsonConverters.toJson(auditResultReasons,'List<String>',context!)
};
getTypeName() => "ProductMatch";
TypeContext? context = _ctx;
}
class PostProductMatchingUpdateCallbackRequest implements IConvertible
{
List<ProductMatch>? productMatches;
Uri? sourceUrl;
PostProductMatchingUpdateCallbackRequest({this.productMatches,this.sourceUrl});
PostProductMatchingUpdateCallbackRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
productMatches = JsonConverters.fromJson(json['productMatches'],'List<ProductMatch>',context!);
sourceUrl = JsonConverters.fromJson(json['sourceUrl'],'Uri',context!);
return this;
}
Map<String, dynamic> toJson() => {
'productMatches': JsonConverters.toJson(productMatches,'List<ProductMatch>',context!),
'sourceUrl': JsonConverters.toJson(sourceUrl,'Uri',context!)
};
getTypeName() => "PostProductMatchingUpdateCallbackRequest";
TypeContext? context = _ctx;
}
class PostProductMatchingUpdateCallbackResponse implements IConvertible
{
ResponseStatus? responseStatus;
PostProductMatchingUpdateCallbackResponse({this.responseStatus});
PostProductMatchingUpdateCallbackResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
};
getTypeName() => "PostProductMatchingUpdateCallbackResponse";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'product_matching_api.kit.co', types: <String, TypeInfo> {
'ProductMatch': TypeInfo(TypeOf.Class, create:() => ProductMatch()),
'Uri': TypeInfo(TypeOf.Class, create:() => Uri()),
'PostProductMatchingUpdateCallbackRequest': TypeInfo(TypeOf.Class, create:() => PostProductMatchingUpdateCallbackRequest()),
'List<ProductMatch>': TypeInfo(TypeOf.Class, create:() => <ProductMatch>[]),
'PostProductMatchingUpdateCallbackResponse': TypeInfo(TypeOf.Class, create:() => PostProductMatchingUpdateCallbackResponse()),
});
Dart PostProductMatchingUpdateCallbackRequest 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 /v1/product-matching-update-callback HTTP/1.1
Host: product-matching-api.kit.co
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<PostProductMatchingUpdateCallbackRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ProductMatching.API.ServiceModel.V1.ProductMatching">
<ProductMatches xmlns:d2p1="http://schemas.datacontract.org/2004/07/ProductMatching.API.ServiceModel.DTOs">
<d2p1:ProductMatch>
<d2p1:auditResult>String</d2p1:auditResult>
<d2p1:auditResultReasons xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</d2p1:auditResultReasons>
<d2p1:brand>String</d2p1:brand>
<d2p1:description>String</d2p1:description>
<d2p1:ean13>String</d2p1:ean13>
<d2p1:ean8>String</d2p1:ean8>
<d2p1:gtin>String</d2p1:gtin>
<d2p1:isbn>String</d2p1:isbn>
<d2p1:productImageUrl i:nil="true" />
<d2p1:productName>String</d2p1:productName>
<d2p1:productUrl i:nil="true" />
<d2p1:retailerGuid>00000000-0000-0000-0000-000000000000</d2p1:retailerGuid>
<d2p1:retailerName>String</d2p1:retailerName>
<d2p1:sku>String</d2p1:sku>
<d2p1:upc>String</d2p1:upc>
</d2p1:ProductMatch>
</ProductMatches>
<SourceUrl i:nil="true" />
</PostProductMatchingUpdateCallbackRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <PostProductMatchingUpdateCallbackResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ProductMatching.API.ServiceModel.V1.ProductMatching"> <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types"> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:Message>String</d2p1:Message> <d2p1:StackTrace>String</d2p1:StackTrace> <d2p1:Errors> <d2p1:ResponseError> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:FieldName>String</d2p1:FieldName> <d2p1:Message>String</d2p1:Message> <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:KeyValueOfstringstring> <d5p1:Key>String</d5p1:Key> <d5p1:Value>String</d5p1:Value> </d5p1:KeyValueOfstringstring> </d2p1:Meta> </d2p1:ResponseError> </d2p1:Errors> <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringstring> <d3p1:Key>String</d3p1:Key> <d3p1:Value>String</d3p1:Value> </d3p1:KeyValueOfstringstring> </d2p1:Meta> </ResponseStatus> </PostProductMatchingUpdateCallbackResponse>