| POST | /api/profiles |
|---|
import 'package:servicestack/servicestack.dart';
/**
* Add a Users Profile information'
*/
// @Api(Description="Add a Users Profile information'")
class AddUserProfile implements IConvertible
{
List<String>? UserIds;
List<String>? ContactIds;
String? ProfileToShareId;
AddUserProfile({this.UserIds,this.ContactIds,this.ProfileToShareId});
AddUserProfile.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
UserIds = JsonConverters.fromJson(json['UserIds'],'List<String>',context!);
ContactIds = JsonConverters.fromJson(json['ContactIds'],'List<String>',context!);
ProfileToShareId = json['ProfileToShareId'];
return this;
}
Map<String, dynamic> toJson() => {
'UserIds': JsonConverters.toJson(UserIds,'List<String>',context!),
'ContactIds': JsonConverters.toJson(ContactIds,'List<String>',context!),
'ProfileToShareId': ProfileToShareId
};
getTypeName() => "AddUserProfile";
TypeContext? context = _ctx;
}
class AddUserProfileResponse implements IConvertible
{
List<ResponseError>? Errors;
/**
* Guid representing the object that is the User Profile Id in Eros.
*/
// @ApiMember(DataType="Guid", Description="Guid representing the object that is the User Profile Id in Eros.", Name="UserProfileId", ParameterType="query")
String? ProfileToShareId;
/**
* Service Stack Response Status.
*/
// @ApiMember(DataType="ResponseStatus", Description="Service Stack Response Status.", Name="ResponseStatus", ParameterType="query")
ResponseStatus? ResponseStatus;
AddUserProfileResponse({this.Errors,this.ProfileToShareId,this.ResponseStatus});
AddUserProfileResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Errors = JsonConverters.fromJson(json['Errors'],'List<ResponseError>',context!);
ProfileToShareId = json['ProfileToShareId'];
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Errors': JsonConverters.toJson(Errors,'List<ResponseError>',context!),
'ProfileToShareId': ProfileToShareId,
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "AddUserProfileResponse";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'pfapi.pstpf.com.au', types: <String, TypeInfo> {
'AddUserProfile': TypeInfo(TypeOf.Class, create:() => AddUserProfile()),
'AddUserProfileResponse': TypeInfo(TypeOf.Class, create:() => AddUserProfileResponse()),
});
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 /api/profiles HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
UserIds:
[
00000000-0000-0000-0000-000000000000
],
ContactIds:
[
00000000-0000-0000-0000-000000000000
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}