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 .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
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/json
Content-Type: application/json
Content-Length: length
{"firstName":"String","lastName":"String","emailAddress":"String","customerType":"String","cultureName":"String","phone":{"number":"String","extension":"String","codeIdPhoneType":"String","countryCode":"String"},"caslStatementAgreement":{"agree":"String","date":"0001-01-01T00:00:00.0000000"}}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"beeNumber":0,"accessToken":"String","timestamp":"0001-01-01T00:00:00.0000000"}