| POST | /posttofacebook |
|---|
import 'package:servicestack/servicestack.dart';
class UserAuth implements IConvertible
{
int? id;
String? userName;
String? email;
String? primaryEmail;
String? phoneNumber;
String? firstName;
String? lastName;
String? displayName;
String? company;
DateTime? birthDate;
String? birthDateRaw;
String? address;
String? address2;
String? city;
String? state;
String? country;
String? culture;
String? fullName;
String? gender;
String? language;
String? mailAddress;
String? nickname;
String? postalCode;
String? timeZone;
String? salt;
String? passwordHash;
String? digestHa1Hash;
List<String>? roles;
List<String>? permissions;
DateTime? createdDate;
DateTime? modifiedDate;
int? invalidLoginAttempts;
DateTime? lastLoginAttempt;
DateTime? lockedDate;
String? recoveryToken;
int? refId;
String? refIdStr;
Map<String,String?>? meta;
UserAuth({this.id,this.userName,this.email,this.primaryEmail,this.phoneNumber,this.firstName,this.lastName,this.displayName,this.company,this.birthDate,this.birthDateRaw,this.address,this.address2,this.city,this.state,this.country,this.culture,this.fullName,this.gender,this.language,this.mailAddress,this.nickname,this.postalCode,this.timeZone,this.salt,this.passwordHash,this.digestHa1Hash,this.roles,this.permissions,this.createdDate,this.modifiedDate,this.invalidLoginAttempts,this.lastLoginAttempt,this.lockedDate,this.recoveryToken,this.refId,this.refIdStr,this.meta});
UserAuth.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
userName = json['userName'];
email = json['email'];
primaryEmail = json['primaryEmail'];
phoneNumber = json['phoneNumber'];
firstName = json['firstName'];
lastName = json['lastName'];
displayName = json['displayName'];
company = json['company'];
birthDate = JsonConverters.fromJson(json['birthDate'],'DateTime',context!);
birthDateRaw = json['birthDateRaw'];
address = json['address'];
address2 = json['address2'];
city = json['city'];
state = json['state'];
country = json['country'];
culture = json['culture'];
fullName = json['fullName'];
gender = json['gender'];
language = json['language'];
mailAddress = json['mailAddress'];
nickname = json['nickname'];
postalCode = json['postalCode'];
timeZone = json['timeZone'];
salt = json['salt'];
passwordHash = json['passwordHash'];
digestHa1Hash = json['digestHa1Hash'];
roles = JsonConverters.fromJson(json['roles'],'List<String>',context!);
permissions = JsonConverters.fromJson(json['permissions'],'List<String>',context!);
createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
modifiedDate = JsonConverters.fromJson(json['modifiedDate'],'DateTime',context!);
invalidLoginAttempts = json['invalidLoginAttempts'];
lastLoginAttempt = JsonConverters.fromJson(json['lastLoginAttempt'],'DateTime',context!);
lockedDate = JsonConverters.fromJson(json['lockedDate'],'DateTime',context!);
recoveryToken = json['recoveryToken'];
refId = json['refId'];
refIdStr = json['refIdStr'];
meta = JsonConverters.toStringMap(json['meta']);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'userName': userName,
'email': email,
'primaryEmail': primaryEmail,
'phoneNumber': phoneNumber,
'firstName': firstName,
'lastName': lastName,
'displayName': displayName,
'company': company,
'birthDate': JsonConverters.toJson(birthDate,'DateTime',context!),
'birthDateRaw': birthDateRaw,
'address': address,
'address2': address2,
'city': city,
'state': state,
'country': country,
'culture': culture,
'fullName': fullName,
'gender': gender,
'language': language,
'mailAddress': mailAddress,
'nickname': nickname,
'postalCode': postalCode,
'timeZone': timeZone,
'salt': salt,
'passwordHash': passwordHash,
'digestHa1Hash': digestHa1Hash,
'roles': JsonConverters.toJson(roles,'List<String>',context!),
'permissions': JsonConverters.toJson(permissions,'List<String>',context!),
'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!),
'modifiedDate': JsonConverters.toJson(modifiedDate,'DateTime',context!),
'invalidLoginAttempts': invalidLoginAttempts,
'lastLoginAttempt': JsonConverters.toJson(lastLoginAttempt,'DateTime',context!),
'lockedDate': JsonConverters.toJson(lockedDate,'DateTime',context!),
'recoveryToken': recoveryToken,
'refId': refId,
'refIdStr': refIdStr,
'meta': meta
};
getTypeName() => "UserAuth";
TypeContext? context = _ctx;
}
class PostToFacebook implements IConvertible
{
String? postText;
String? pictureUrl;
ResponseStatus? responseStatus;
PostToFacebook({this.postText,this.pictureUrl,this.responseStatus});
PostToFacebook.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
postText = json['postText'];
pictureUrl = json['pictureUrl'];
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'postText': postText,
'pictureUrl': pictureUrl,
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
};
getTypeName() => "PostToFacebook";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'sfgboxapi.dev.scadsoftware.com', types: <String, TypeInfo> {
'UserAuth': TypeInfo(TypeOf.Class, create:() => UserAuth()),
'PostToFacebook': TypeInfo(TypeOf.Class, create:() => PostToFacebook()),
});
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 /posttofacebook HTTP/1.1
Host: sfgboxapi.dev.scadsoftware.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
postText: String,
pictureUrl: String,
responseStatus:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
id: 0,
userName: String,
email: String,
primaryEmail: String,
phoneNumber: String,
firstName: String,
lastName: String,
displayName: String,
company: String,
birthDate: 0001-01-01,
birthDateRaw: String,
address: String,
address2: String,
city: String,
state: String,
country: String,
culture: String,
fullName: String,
gender: String,
language: String,
mailAddress: String,
nickname: String,
postalCode: String,
timeZone: String,
salt: String,
passwordHash: String,
digestHa1Hash: String,
roles:
[
String
],
permissions:
[
String
],
createdDate: 0001-01-01,
modifiedDate: 0001-01-01,
invalidLoginAttempts: 0,
lastLoginAttempt: 0001-01-01,
lockedDate: 0001-01-01,
recoveryToken: String,
refId: 0,
refIdStr: String,
meta:
{
String: String
}
}