Platform API

<back to all web services

UpdateContactRoleGroup

Update contact role group

Requires Authentication
The following routes are available for this service:
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 .jsv suffix or ?format=jsv

HTTP + JSV

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/jsv
Content-Type: text/jsv
Content-Length: length

{
	Name: String,
	Roles: 
	[
		{
			Name: String,
			Description: String,
			ShortName: String,
			IsDefault: False,
			Order: 0,
			PrimaryListItemImageUrl: String,
			PrimaryImageThumbnailUrl: String,
			RecordStatus: String
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ErrorCode: String,
	Message: String,
	StackTrace: String,
	Errors: 
	[
		{
			ErrorCode: String,
			FieldName: String,
			Message: String,
			Meta: 
			{
				String: String
			}
		}
	],
	Meta: 
	{
		String: String
	}
}