| POST | /warranty/v1/GetCustomerSuggestion |
|---|
import 'package:servicestack/servicestack.dart';
class BaseRequest<TResponse> implements IRequest, IConvertible
{
String? sid;
String? app;
String? _os;
String? _appVersion;
String? _searchMethod;
BaseRequest({this.sid,this.app,this._os,this._appVersion,this._searchMethod});
BaseRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
sid = json['sid'];
app = json['app'];
_os = json['_os'];
_appVersion = json['_appVersion'];
_searchMethod = json['_searchMethod'];
return this;
}
Map<String, dynamic> toJson() => {
'sid': sid,
'app': app,
'_os': _os,
'_appVersion': _appVersion,
'_searchMethod': _searchMethod
};
getTypeName() => "BaseRequest<$TResponse>";
TypeContext? context = _ctx;
}
class BaseResponse implements IRespose, IConvertible
{
String? _xmlns;
String? _type;
String? _source;
String? _tstamp;
String? _user;
String? _env;
String? _uri;
String? _query;
BaseResponse({this._xmlns,this._type,this._source,this._tstamp,this._user,this._env,this._uri,this._query});
BaseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
_xmlns = json['_xmlns'];
_type = json['_type'];
_source = json['_source'];
_tstamp = json['_tstamp'];
_user = json['_user'];
_env = json['_env'];
_uri = json['_uri'];
_query = json['_query'];
return this;
}
Map<String, dynamic> toJson() => {
'_xmlns': _xmlns,
'_type': _type,
'_source': _source,
'_tstamp': _tstamp,
'_user': _user,
'_env': _env,
'_uri': _uri,
'_query': _query
};
getTypeName() => "BaseResponse";
TypeContext? context = _ctx;
}
class CustomerAddress implements IConvertible
{
String? addressId;
String? description;
String? addressLine1;
String? addressLine2;
String? addressLine3;
String? addressLine4;
String? addressLine5;
String? houseNumber;
String? city;
String? region;
String? county;
String? stateOrProvinceId;
String? countryId;
String? countryDs;
String? zipCode;
String? addressTypeId;
bool? isMailingAddress;
bool? isMainAddress;
CustomerAddress({this.addressId,this.description,this.addressLine1,this.addressLine2,this.addressLine3,this.addressLine4,this.addressLine5,this.houseNumber,this.city,this.region,this.county,this.stateOrProvinceId,this.countryId,this.countryDs,this.zipCode,this.addressTypeId,this.isMailingAddress,this.isMainAddress});
CustomerAddress.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
addressId = json['addressId'];
description = json['description'];
addressLine1 = json['addressLine1'];
addressLine2 = json['addressLine2'];
addressLine3 = json['addressLine3'];
addressLine4 = json['addressLine4'];
addressLine5 = json['addressLine5'];
houseNumber = json['houseNumber'];
city = json['city'];
region = json['region'];
county = json['county'];
stateOrProvinceId = json['stateOrProvinceId'];
countryId = json['countryId'];
countryDs = json['countryDs'];
zipCode = json['zipCode'];
addressTypeId = json['addressTypeId'];
isMailingAddress = json['isMailingAddress'];
isMainAddress = json['isMainAddress'];
return this;
}
Map<String, dynamic> toJson() => {
'addressId': addressId,
'description': description,
'addressLine1': addressLine1,
'addressLine2': addressLine2,
'addressLine3': addressLine3,
'addressLine4': addressLine4,
'addressLine5': addressLine5,
'houseNumber': houseNumber,
'city': city,
'region': region,
'county': county,
'stateOrProvinceId': stateOrProvinceId,
'countryId': countryId,
'countryDs': countryDs,
'zipCode': zipCode,
'addressTypeId': addressTypeId,
'isMailingAddress': isMailingAddress,
'isMainAddress': isMainAddress
};
getTypeName() => "CustomerAddress";
TypeContext? context = _ctx;
}
class CustomerEmail implements IConvertible
{
String? emailId;
String? description;
String? email;
bool? isMainEmail;
Lookup<String>? type;
CustomerEmail({this.emailId,this.description,this.email,this.isMainEmail,this.type});
CustomerEmail.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
emailId = json['emailId'];
description = json['description'];
email = json['email'];
isMainEmail = json['isMainEmail'];
type = JsonConverters.fromJson(json['type'],'Lookup<String>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'emailId': emailId,
'description': description,
'email': email,
'isMainEmail': isMainEmail,
'type': JsonConverters.toJson(type,'Lookup<String>',context!)
};
getTypeName() => "CustomerEmail";
TypeContext? context = _ctx;
}
class CustomerPhone implements IConvertible
{
String? phoneId;
String? description;
String? phone;
bool? isMainPhone;
String? prefixCountryId;
String? telephonePrefix;
Lookup<int>? type;
CustomerPhone({this.phoneId,this.description,this.phone,this.isMainPhone,this.prefixCountryId,this.telephonePrefix,this.type});
CustomerPhone.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
phoneId = json['phoneId'];
description = json['description'];
phone = json['phone'];
isMainPhone = json['isMainPhone'];
prefixCountryId = json['prefixCountryId'];
telephonePrefix = json['telephonePrefix'];
type = JsonConverters.fromJson(json['type'],'Lookup<int>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'phoneId': phoneId,
'description': description,
'phone': phone,
'isMainPhone': isMainPhone,
'prefixCountryId': prefixCountryId,
'telephonePrefix': telephonePrefix,
'type': JsonConverters.toJson(type,'Lookup<int>',context!)
};
getTypeName() => "CustomerPhone";
TypeContext? context = _ctx;
}
class GetCustomerSuggestionResponse extends BaseResponse implements IConvertible
{
String? customerType;
String? customerRef;
int? title;
String? titleDs;
String? firstName;
String? lastName;
String? firstNameNotLatin;
String? lastNameNotLatin;
String? birthday;
String? birthDayEventId;
String? weddingDate;
bool? canBeContacted;
String? seller;
String? language;
String? languageDs;
String? nameSuffix;
String? gender;
String? companyName;
String? middleName;
String? customerId;
String? personId;
int? boosterCustomerId;
int? posOwnerId;
String? brandOwnerId;
int? businessUnitId;
String? sapGenderId;
bool? allowStoreDataAbroad;
bool? privacyPolicyAcceptanceStorage;
bool? tvAllowStoreDataAbroad;
bool? tvPrivacyPolicyAcceptanceStorage;
bool? contactByMail;
bool? contactByEmail;
bool? contactByPhone;
bool? contactBySMS;
bool? contactBySocialMedia;
List<CustomerAddress>? addresses;
List<CustomerEmail>? emails;
List<CustomerPhone>? phones;
ResponseStatus? ResponseStatus;
GetCustomerSuggestionResponse({this.customerType,this.customerRef,this.title,this.titleDs,this.firstName,this.lastName,this.firstNameNotLatin,this.lastNameNotLatin,this.birthday,this.birthDayEventId,this.weddingDate,this.canBeContacted,this.seller,this.language,this.languageDs,this.nameSuffix,this.gender,this.companyName,this.middleName,this.customerId,this.personId,this.boosterCustomerId,this.posOwnerId,this.brandOwnerId,this.businessUnitId,this.sapGenderId,this.allowStoreDataAbroad,this.privacyPolicyAcceptanceStorage,this.tvAllowStoreDataAbroad,this.tvPrivacyPolicyAcceptanceStorage,this.contactByMail,this.contactByEmail,this.contactByPhone,this.contactBySMS,this.contactBySocialMedia,this.addresses,this.emails,this.phones,this.ResponseStatus});
GetCustomerSuggestionResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
customerType = json['customerType'];
customerRef = json['customerRef'];
title = json['title'];
titleDs = json['titleDs'];
firstName = json['firstName'];
lastName = json['lastName'];
firstNameNotLatin = json['firstNameNotLatin'];
lastNameNotLatin = json['lastNameNotLatin'];
birthday = json['birthday'];
birthDayEventId = json['birthDayEventId'];
weddingDate = json['weddingDate'];
canBeContacted = json['canBeContacted'];
seller = json['seller'];
language = json['language'];
languageDs = json['languageDs'];
nameSuffix = json['nameSuffix'];
gender = json['gender'];
companyName = json['companyName'];
middleName = json['middleName'];
customerId = json['customerId'];
personId = json['personId'];
boosterCustomerId = json['boosterCustomerId'];
posOwnerId = json['posOwnerId'];
brandOwnerId = json['brandOwnerId'];
businessUnitId = json['businessUnitId'];
sapGenderId = json['sapGenderId'];
allowStoreDataAbroad = json['allowStoreDataAbroad'];
privacyPolicyAcceptanceStorage = json['privacyPolicyAcceptanceStorage'];
tvAllowStoreDataAbroad = json['tvAllowStoreDataAbroad'];
tvPrivacyPolicyAcceptanceStorage = json['tvPrivacyPolicyAcceptanceStorage'];
contactByMail = json['contactByMail'];
contactByEmail = json['contactByEmail'];
contactByPhone = json['contactByPhone'];
contactBySMS = json['contactBySMS'];
contactBySocialMedia = json['contactBySocialMedia'];
addresses = JsonConverters.fromJson(json['addresses'],'List<CustomerAddress>',context!);
emails = JsonConverters.fromJson(json['emails'],'List<CustomerEmail>',context!);
phones = JsonConverters.fromJson(json['phones'],'List<CustomerPhone>',context!);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'customerType': customerType,
'customerRef': customerRef,
'title': title,
'titleDs': titleDs,
'firstName': firstName,
'lastName': lastName,
'firstNameNotLatin': firstNameNotLatin,
'lastNameNotLatin': lastNameNotLatin,
'birthday': birthday,
'birthDayEventId': birthDayEventId,
'weddingDate': weddingDate,
'canBeContacted': canBeContacted,
'seller': seller,
'language': language,
'languageDs': languageDs,
'nameSuffix': nameSuffix,
'gender': gender,
'companyName': companyName,
'middleName': middleName,
'customerId': customerId,
'personId': personId,
'boosterCustomerId': boosterCustomerId,
'posOwnerId': posOwnerId,
'brandOwnerId': brandOwnerId,
'businessUnitId': businessUnitId,
'sapGenderId': sapGenderId,
'allowStoreDataAbroad': allowStoreDataAbroad,
'privacyPolicyAcceptanceStorage': privacyPolicyAcceptanceStorage,
'tvAllowStoreDataAbroad': tvAllowStoreDataAbroad,
'tvPrivacyPolicyAcceptanceStorage': tvPrivacyPolicyAcceptanceStorage,
'contactByMail': contactByMail,
'contactByEmail': contactByEmail,
'contactByPhone': contactByPhone,
'contactBySMS': contactBySMS,
'contactBySocialMedia': contactBySocialMedia,
'addresses': JsonConverters.toJson(addresses,'List<CustomerAddress>',context!),
'emails': JsonConverters.toJson(emails,'List<CustomerEmail>',context!),
'phones': JsonConverters.toJson(phones,'List<CustomerPhone>',context!),
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
});
getTypeName() => "GetCustomerSuggestionResponse";
TypeContext? context = _ctx;
}
class GetCustomerSuggestion extends BaseRequest<GetCustomerSuggestionResponse> implements IConvertible
{
String? emailAddress;
int? posId;
String? brandTrigram;
String? phoneNumber;
String? prefixCountryId;
String? countryId;
GetCustomerSuggestion({this.emailAddress,this.posId,this.brandTrigram,this.phoneNumber,this.prefixCountryId,this.countryId});
GetCustomerSuggestion.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
emailAddress = json['emailAddress'];
posId = json['posId'];
brandTrigram = json['brandTrigram'];
phoneNumber = json['phoneNumber'];
prefixCountryId = json['prefixCountryId'];
countryId = json['countryId'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'emailAddress': emailAddress,
'posId': posId,
'brandTrigram': brandTrigram,
'phoneNumber': phoneNumber,
'prefixCountryId': prefixCountryId,
'countryId': countryId
});
getTypeName() => "GetCustomerSuggestion";
TypeContext? context = _ctx;
}
class Lookup<T> implements IConvertible
{
T? Id;
String? Description;
Lookup({this.Id,this.Description});
Lookup.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = JsonConverters.fromJson(json['Id'],'T',context!);
Description = json['Description'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': JsonConverters.toJson(Id,'T',context!),
'Description': Description
};
getTypeName() => "Lookup<$T>";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'qp_microservices_booster.richemont.com', types: <String, TypeInfo> {
'BaseRequest<TResponse>': TypeInfo(TypeOf.Class, create:() => BaseRequest<TResponse>()),
'BaseResponse': TypeInfo(TypeOf.Class, create:() => BaseResponse()),
'CustomerAddress': TypeInfo(TypeOf.Class, create:() => CustomerAddress()),
'CustomerEmail': TypeInfo(TypeOf.Class, create:() => CustomerEmail()),
'Lookup<String>': TypeInfo(TypeOf.Class, create:() => Lookup<String>()),
'CustomerPhone': TypeInfo(TypeOf.Class, create:() => CustomerPhone()),
'Lookup<int>': TypeInfo(TypeOf.Class, create:() => Lookup<int>()),
'GetCustomerSuggestionResponse': TypeInfo(TypeOf.Class, create:() => GetCustomerSuggestionResponse()),
'List<CustomerAddress>': TypeInfo(TypeOf.Class, create:() => <CustomerAddress>[]),
'List<CustomerEmail>': TypeInfo(TypeOf.Class, create:() => <CustomerEmail>[]),
'List<CustomerPhone>': TypeInfo(TypeOf.Class, create:() => <CustomerPhone>[]),
'GetCustomerSuggestion': TypeInfo(TypeOf.Class, create:() => GetCustomerSuggestion()),
'Lookup<T>': TypeInfo(TypeOf.Class, create:() => Lookup<T>()),
'T': TypeInfo(TypeOf.Class, create:() => T()),
});
Dart GetCustomerSuggestion 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 /warranty/v1/GetCustomerSuggestion HTTP/1.1
Host: qp-microservices-booster.richemont.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GetCustomerSuggestion xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Sale">
<_appVersion xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_appVersion>
<_os xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_os>
<_searchMethod xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_searchMethod>
<app xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</app>
<sid xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</sid>
<brandTrigram>String</brandTrigram>
<countryId>String</countryId>
<emailAddress>String</emailAddress>
<phoneNumber>String</phoneNumber>
<posId>0</posId>
<prefixCountryId>String</prefixCountryId>
</GetCustomerSuggestion>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetCustomerSuggestionResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Sale">
<_env xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_env>
<_query xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_query>
<_source xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_source>
<_tstamp xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_tstamp>
<_type xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_type>
<_uri xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_uri>
<_user xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_user>
<_xmlns xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_xmlns>
<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>
<addresses>
<CustomerAddress>
<addressId>00000000-0000-0000-0000-000000000000</addressId>
<addressLine1>String</addressLine1>
<addressLine2>String</addressLine2>
<addressLine3>String</addressLine3>
<addressLine4>String</addressLine4>
<addressLine5>String</addressLine5>
<addressTypeId>String</addressTypeId>
<city>String</city>
<countryDs>String</countryDs>
<countryId>String</countryId>
<county>String</county>
<description>String</description>
<houseNumber>String</houseNumber>
<isMailingAddress>false</isMailingAddress>
<isMainAddress>false</isMainAddress>
<region>String</region>
<stateOrProvinceId>String</stateOrProvinceId>
<zipCode>String</zipCode>
</CustomerAddress>
</addresses>
<allowStoreDataAbroad>false</allowStoreDataAbroad>
<birthDayEventId>00000000-0000-0000-0000-000000000000</birthDayEventId>
<birthday>String</birthday>
<boosterCustomerId>0</boosterCustomerId>
<brandOwnerId>String</brandOwnerId>
<businessUnitId>0</businessUnitId>
<canBeContacted>false</canBeContacted>
<companyName>String</companyName>
<contactByEmail>false</contactByEmail>
<contactByMail>false</contactByMail>
<contactByPhone>false</contactByPhone>
<contactBySMS>false</contactBySMS>
<contactBySocialMedia>false</contactBySocialMedia>
<customerId>00000000-0000-0000-0000-000000000000</customerId>
<customerRef>String</customerRef>
<customerType>String</customerType>
<emails>
<CustomerEmail>
<description>String</description>
<email>String</email>
<emailId>00000000-0000-0000-0000-000000000000</emailId>
<isMainEmail>false</isMainEmail>
<type xmlns:d4p1="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">
<d4p1:Description>String</d4p1:Description>
<d4p1:Id>0</d4p1:Id>
</type>
</CustomerEmail>
</emails>
<firstName>String</firstName>
<firstNameNotLatin>String</firstNameNotLatin>
<gender>String</gender>
<language>String</language>
<languageDs>String</languageDs>
<lastName>String</lastName>
<lastNameNotLatin>String</lastNameNotLatin>
<middleName>String</middleName>
<nameSuffix>String</nameSuffix>
<personId>00000000-0000-0000-0000-000000000000</personId>
<phones>
<CustomerPhone>
<description>String</description>
<isMainPhone>false</isMainPhone>
<phone>String</phone>
<phoneId>00000000-0000-0000-0000-000000000000</phoneId>
<prefixCountryId>String</prefixCountryId>
<telephonePrefix>String</telephonePrefix>
<type xmlns:d4p1="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">
<d4p1:Description>String</d4p1:Description>
<d4p1:Id>0</d4p1:Id>
</type>
</CustomerPhone>
</phones>
<posOwnerId>0</posOwnerId>
<privacyPolicyAcceptanceStorage>false</privacyPolicyAcceptanceStorage>
<sapGenderId>String</sapGenderId>
<seller>00000000-0000-0000-0000-000000000000</seller>
<title>0</title>
<titleDs>String</titleDs>
<tvAllowStoreDataAbroad>false</tvAllowStoreDataAbroad>
<tvPrivacyPolicyAcceptanceStorage>false</tvPrivacyPolicyAcceptanceStorage>
<weddingDate>String</weddingDate>
</GetCustomerSuggestionResponse>