| 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 .jsv suffix or ?format=jsv
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: text/jsv
Content-Type: text/jsv
Content-Length: length
{
emailAddress: String,
posId: 0,
brandTrigram: String,
phoneNumber: String,
prefixCountryId: String,
countryId: String,
sid: String,
app: String,
_os: String,
_appVersion: String,
_searchMethod: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
customerType: String,
customerRef: String,
title: 0,
titleDs: String,
firstName: String,
lastName: String,
firstNameNotLatin: String,
lastNameNotLatin: String,
birthday: String,
birthDayEventId: 00000000000000000000000000000000,
weddingDate: String,
canBeContacted: False,
seller: 00000000000000000000000000000000,
language: String,
languageDs: String,
nameSuffix: String,
gender: String,
companyName: String,
middleName: String,
customerId: 00000000000000000000000000000000,
personId: 00000000000000000000000000000000,
boosterCustomerId: 0,
posOwnerId: 0,
brandOwnerId: String,
businessUnitId: 0,
sapGenderId: String,
allowStoreDataAbroad: False,
privacyPolicyAcceptanceStorage: False,
tvAllowStoreDataAbroad: False,
tvPrivacyPolicyAcceptanceStorage: False,
contactByMail: False,
contactByEmail: False,
contactByPhone: False,
contactBySMS: False,
contactBySocialMedia: False,
addresses:
[
{
addressId: 00000000000000000000000000000000,
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: String,
isMailingAddress: False,
isMainAddress: False
}
],
emails:
[
{
emailId: 00000000000000000000000000000000,
description: String,
email: String,
isMainEmail: False,
type:
{
Id: ,
Description: String
}
}
],
phones:
[
{
phoneId: 00000000000000000000000000000000,
description: String,
phone: String,
isMainPhone: False,
prefixCountryId: String,
telephonePrefix: String,
type:
{
Id: 0,
Description: String
}
}
],
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
_xmlns: String,
_type: String,
_source: String,
_tstamp: String,
_user: String,
_env: String,
_uri: String,
_query: String
}