| POST | /api/contactrolegroups |
|---|
import 'package:servicestack/servicestack.dart';
// @ApiResponse(Description="Create contact role group")
class AddContactRoleGroupResponse implements IConvertible
{
String? ContactRoleGroupId;
ResponseStatus? ResponseStatus;
AddContactRoleGroupResponse({this.ContactRoleGroupId,this.ResponseStatus});
AddContactRoleGroupResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ContactRoleGroupId = json['ContactRoleGroupId'];
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ContactRoleGroupId': ContactRoleGroupId,
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "AddContactRoleGroupResponse";
TypeContext? context = _ctx;
}
class ListItemModel implements IConvertible
{
String? ListItemId;
String? Name;
String? Description;
String? ShortName;
bool? IsDefault;
int? Order;
String? ListItemTrafficLightId;
String? PrimaryListItemImageId;
String? PrimaryListItemImageUrl;
String? PrimaryImageThumbnailUrl;
String? OwnerContactId;
String? RecordStatus;
ListItemModel({this.ListItemId,this.Name,this.Description,this.ShortName,this.IsDefault,this.Order,this.ListItemTrafficLightId,this.PrimaryListItemImageId,this.PrimaryListItemImageUrl,this.PrimaryImageThumbnailUrl,this.OwnerContactId,this.RecordStatus});
ListItemModel.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ListItemId = json['ListItemId'];
Name = json['Name'];
Description = json['Description'];
ShortName = json['ShortName'];
IsDefault = json['IsDefault'];
Order = json['Order'];
ListItemTrafficLightId = json['ListItemTrafficLightId'];
PrimaryListItemImageId = json['PrimaryListItemImageId'];
PrimaryListItemImageUrl = json['PrimaryListItemImageUrl'];
PrimaryImageThumbnailUrl = json['PrimaryImageThumbnailUrl'];
OwnerContactId = json['OwnerContactId'];
RecordStatus = json['RecordStatus'];
return this;
}
Map<String, dynamic> toJson() => {
'ListItemId': ListItemId,
'Name': Name,
'Description': Description,
'ShortName': ShortName,
'IsDefault': IsDefault,
'Order': Order,
'ListItemTrafficLightId': ListItemTrafficLightId,
'PrimaryListItemImageId': PrimaryListItemImageId,
'PrimaryListItemImageUrl': PrimaryListItemImageUrl,
'PrimaryImageThumbnailUrl': PrimaryImageThumbnailUrl,
'OwnerContactId': OwnerContactId,
'RecordStatus': RecordStatus
};
getTypeName() => "ListItemModel";
TypeContext? context = _ctx;
}
/**
* Create new contact role group
*/
// @Api(Description="Create new contact role group")
class AddContactRoleGroup implements IConvertible
{
/**
* Contact role group name to be created
*/
// @ApiMember(Description="Contact role group name to be created", Name="Name")
String? Name;
List<ListItemModel>? Roles;
AddContactRoleGroup({this.Name,this.Roles});
AddContactRoleGroup.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Name = json['Name'];
Roles = JsonConverters.fromJson(json['Roles'],'List<ListItemModel>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Name': Name,
'Roles': JsonConverters.toJson(Roles,'List<ListItemModel>',context!)
};
getTypeName() => "AddContactRoleGroup";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'pfapi.pstpf.com.au', types: <String, TypeInfo> {
'AddContactRoleGroupResponse': TypeInfo(TypeOf.Class, create:() => AddContactRoleGroupResponse()),
'ListItemModel': TypeInfo(TypeOf.Class, create:() => ListItemModel()),
'AddContactRoleGroup': TypeInfo(TypeOf.Class, create:() => AddContactRoleGroup()),
'List<ListItemModel>': TypeInfo(TypeOf.Class, create:() => <ListItemModel>[]),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/contactrolegroups HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"Name":"String","Roles":[{"ListItemId":"00000000-0000-0000-0000-000000000000","Name":"String","Description":"String","ShortName":"String","IsDefault":false,"Order":0,"ListItemTrafficLightId":"00000000-0000-0000-0000-000000000000","PrimaryListItemImageId":"00000000-0000-0000-0000-000000000000","PrimaryListItemImageUrl":"String","PrimaryImageThumbnailUrl":"String","OwnerContactId":"00000000-0000-0000-0000-000000000000","RecordStatus":"String"}]}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"ContactRoleGroupId":"00000000-0000-0000-0000-000000000000","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}