POST | /profile/sign-up |
---|
import 'package:servicestack/servicestack.dart';
class ProfileSignUpCreateResponse implements IConvertible
{
ResponseStatus? responseStatus;
double? beeNumber;
String? accessToken;
DateTime? timestamp;
ProfileSignUpCreateResponse({this.responseStatus,this.beeNumber,this.accessToken,this.timestamp});
ProfileSignUpCreateResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
beeNumber = JsonConverters.toDouble(json['beeNumber']);
accessToken = json['accessToken'];
timestamp = JsonConverters.fromJson(json['timestamp'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!),
'beeNumber': beeNumber,
'accessToken': accessToken,
'timestamp': JsonConverters.toJson(timestamp,'DateTime',context!)
};
getTypeName() => "ProfileSignUpCreateResponse";
TypeContext? context = _ctx;
}
class NAVPhoneUpdate implements IConvertible
{
String? number;
String? extension;
String? codeIdPhoneType;
String? countryCode;
NAVPhoneUpdate({this.number,this.extension,this.codeIdPhoneType,this.countryCode});
NAVPhoneUpdate.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
number = json['number'];
extension = json['extension'];
codeIdPhoneType = json['codeIdPhoneType'];
countryCode = json['countryCode'];
return this;
}
Map<String, dynamic> toJson() => {
'number': number,
'extension': extension,
'codeIdPhoneType': codeIdPhoneType,
'countryCode': countryCode
};
getTypeName() => "NAVPhoneUpdate";
TypeContext? context = _ctx;
}
class NAVCASLTermsUpdate implements IConvertible
{
String? agree;
DateTime? date;
NAVCASLTermsUpdate({this.agree,this.date});
NAVCASLTermsUpdate.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
agree = json['agree'];
date = JsonConverters.fromJson(json['date'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'agree': agree,
'date': JsonConverters.toJson(date,'DateTime',context!)
};
getTypeName() => "NAVCASLTermsUpdate";
TypeContext? context = _ctx;
}
class ProfileSignUpCreate implements IPost, IConvertible
{
String? firstName;
String? lastName;
String? emailAddress;
String? customerType;
String? cultureName;
NAVPhoneUpdate? phone;
NAVCASLTermsUpdate? caslStatementAgreement;
ProfileSignUpCreate({this.firstName,this.lastName,this.emailAddress,this.customerType,this.cultureName,this.phone,this.caslStatementAgreement});
ProfileSignUpCreate.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
firstName = json['firstName'];
lastName = json['lastName'];
emailAddress = json['emailAddress'];
customerType = json['customerType'];
cultureName = json['cultureName'];
phone = JsonConverters.fromJson(json['phone'],'NAVPhoneUpdate',context!);
caslStatementAgreement = JsonConverters.fromJson(json['caslStatementAgreement'],'NAVCASLTermsUpdate',context!);
return this;
}
Map<String, dynamic> toJson() => {
'firstName': firstName,
'lastName': lastName,
'emailAddress': emailAddress,
'customerType': customerType,
'cultureName': cultureName,
'phone': JsonConverters.toJson(phone,'NAVPhoneUpdate',context!),
'caslStatementAgreement': JsonConverters.toJson(caslStatementAgreement,'NAVCASLTermsUpdate',context!)
};
getTypeName() => "ProfileSignUpCreate";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'extensions.avon.ca', types: <String, TypeInfo> {
'ProfileSignUpCreateResponse': TypeInfo(TypeOf.Class, create:() => ProfileSignUpCreateResponse()),
'NAVPhoneUpdate': TypeInfo(TypeOf.Class, create:() => NAVPhoneUpdate()),
'NAVCASLTermsUpdate': TypeInfo(TypeOf.Class, create:() => NAVCASLTermsUpdate()),
'ProfileSignUpCreate': TypeInfo(TypeOf.Class, create:() => ProfileSignUpCreate()),
});
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 /profile/sign-up HTTP/1.1
Host: extensions.avon.ca
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<ProfileSignUpCreate xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/NAV.ServiceModel">
<CASLStatementAgreement>
<Agree>String</Agree>
<Date>0001-01-01T00:00:00</Date>
</CASLStatementAgreement>
<CultureName>String</CultureName>
<CustomerType>String</CustomerType>
<EmailAddress>String</EmailAddress>
<FirstName>String</FirstName>
<LastName>String</LastName>
<Phone>
<CodeIdPhoneType>String</CodeIdPhoneType>
<CountryCode>String</CountryCode>
<Extension>String</Extension>
<Number>String</Number>
</Phone>
</ProfileSignUpCreate>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ProfileSignUpCreateResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/NAV.ServiceModel"> <AccessToken>String</AccessToken> <BeeNumber>0</BeeNumber> <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> <Timestamp>0001-01-01T00:00:00</Timestamp> </ProfileSignUpCreateResponse>