| PUT | /api/contactrolegroups |
|---|
import 'package:servicestack/servicestack.dart';
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;
}
/**
* Update contact role group
*/
// @Api(Description="Update contact role group")
class UpdateContactRoleGroup implements IConvertible
{
/**
* Guid of the Contact Role Group to be updated.
*/
// @ApiMember(DataType="Guid", Description="Guid of the Contact Role Group to be updated.", IsRequired=true, Name="RoleGroupId", ParameterType="query")
String? RoleGroupId;
/**
* Contact role group name to be updated
*/
// @ApiMember(DataType="string", Description="Contact role group name to be updated", IsRequired=true, Name="Name", ParameterType="query")
String? Name;
List<ListItemModel>? Roles;
UpdateContactRoleGroup({this.RoleGroupId,this.Name,this.Roles});
UpdateContactRoleGroup.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
RoleGroupId = json['RoleGroupId'];
Name = json['Name'];
Roles = JsonConverters.fromJson(json['Roles'],'List<ListItemModel>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'RoleGroupId': RoleGroupId,
'Name': Name,
'Roles': JsonConverters.toJson(Roles,'List<ListItemModel>',context!)
};
getTypeName() => "UpdateContactRoleGroup";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'pfapi.pstpf.com.au', types: <String, TypeInfo> {
'ListItemModel': TypeInfo(TypeOf.Class, create:() => ListItemModel()),
'UpdateContactRoleGroup': TypeInfo(TypeOf.Class, create:() => UpdateContactRoleGroup()),
'List<ListItemModel>': TypeInfo(TypeOf.Class, create:() => <ListItemModel>[]),
});
Dart UpdateContactRoleGroup DTOs
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.
PUT /api/contactrolegroups HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"RoleGroupId":"00000000-0000-0000-0000-000000000000","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
{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}