| POST | /v1/coverage/restriction |
|---|
import 'package:servicestack/servicestack.dart';
class ClientWorkerRestriction implements IConvertible
{
int? ClientWorkerRestrictionID;
String? BranchId;
int? ClientContactID;
int? WorkerContactID;
String? RestrictionLevel;
String? Reason;
int? SourceRatingID;
String? CreatedBy;
DateTime? CreatedAt;
DateTime? UpdatedAt;
String? ClientName;
String? WorkerName;
String? LevelLabel;
ClientWorkerRestriction({this.ClientWorkerRestrictionID,this.BranchId,this.ClientContactID,this.WorkerContactID,this.RestrictionLevel,this.Reason,this.SourceRatingID,this.CreatedBy,this.CreatedAt,this.UpdatedAt,this.ClientName,this.WorkerName,this.LevelLabel});
ClientWorkerRestriction.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ClientWorkerRestrictionID = json['ClientWorkerRestrictionID'];
BranchId = json['BranchId'];
ClientContactID = json['ClientContactID'];
WorkerContactID = json['WorkerContactID'];
RestrictionLevel = json['RestrictionLevel'];
Reason = json['Reason'];
SourceRatingID = json['SourceRatingID'];
CreatedBy = json['CreatedBy'];
CreatedAt = JsonConverters.fromJson(json['CreatedAt'],'DateTime',context!);
UpdatedAt = JsonConverters.fromJson(json['UpdatedAt'],'DateTime',context!);
ClientName = json['ClientName'];
WorkerName = json['WorkerName'];
LevelLabel = json['LevelLabel'];
return this;
}
Map<String, dynamic> toJson() => {
'ClientWorkerRestrictionID': ClientWorkerRestrictionID,
'BranchId': BranchId,
'ClientContactID': ClientContactID,
'WorkerContactID': WorkerContactID,
'RestrictionLevel': RestrictionLevel,
'Reason': Reason,
'SourceRatingID': SourceRatingID,
'CreatedBy': CreatedBy,
'CreatedAt': JsonConverters.toJson(CreatedAt,'DateTime',context!),
'UpdatedAt': JsonConverters.toJson(UpdatedAt,'DateTime',context!),
'ClientName': ClientName,
'WorkerName': WorkerName,
'LevelLabel': LevelLabel
};
getTypeName() => "ClientWorkerRestriction";
TypeContext? context = _ctx;
}
class RestrictionParty implements IConvertible
{
int? ContactId;
String? Name;
RestrictionParty({this.ContactId,this.Name});
RestrictionParty.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ContactId = json['ContactId'];
Name = json['Name'];
return this;
}
Map<String, dynamic> toJson() => {
'ContactId': ContactId,
'Name': Name
};
getTypeName() => "RestrictionParty";
TypeContext? context = _ctx;
}
class ClientWorkerRestrictionsResponse implements IConvertible
{
List<ClientWorkerRestriction>? Restrictions = [];
List<RestrictionParty>? Clients = [];
List<RestrictionParty>? Workers = [];
ResponseStatus? ResponseStatus;
ClientWorkerRestrictionsResponse({this.Restrictions,this.Clients,this.Workers,this.ResponseStatus});
ClientWorkerRestrictionsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Restrictions = JsonConverters.fromJson(json['Restrictions'],'List<ClientWorkerRestriction>',context!);
Clients = JsonConverters.fromJson(json['Clients'],'List<RestrictionParty>',context!);
Workers = JsonConverters.fromJson(json['Workers'],'List<RestrictionParty>',context!);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Restrictions': JsonConverters.toJson(Restrictions,'List<ClientWorkerRestriction>',context!),
'Clients': JsonConverters.toJson(Clients,'List<RestrictionParty>',context!),
'Workers': JsonConverters.toJson(Workers,'List<RestrictionParty>',context!),
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "ClientWorkerRestrictionsResponse";
TypeContext? context = _ctx;
}
class ClientWorkerRestrictionSetRequest implements IConvertible
{
String? BranchId;
int? ClientContactID;
int? WorkerContactID;
String? RestrictionLevel;
String? Reason;
int? SourceRatingID;
ClientWorkerRestrictionSetRequest({this.BranchId,this.ClientContactID,this.WorkerContactID,this.RestrictionLevel,this.Reason,this.SourceRatingID});
ClientWorkerRestrictionSetRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
BranchId = json['BranchId'];
ClientContactID = json['ClientContactID'];
WorkerContactID = json['WorkerContactID'];
RestrictionLevel = json['RestrictionLevel'];
Reason = json['Reason'];
SourceRatingID = json['SourceRatingID'];
return this;
}
Map<String, dynamic> toJson() => {
'BranchId': BranchId,
'ClientContactID': ClientContactID,
'WorkerContactID': WorkerContactID,
'RestrictionLevel': RestrictionLevel,
'Reason': Reason,
'SourceRatingID': SourceRatingID
};
getTypeName() => "ClientWorkerRestrictionSetRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'ClientWorkerRestriction': TypeInfo(TypeOf.Class, create:() => ClientWorkerRestriction()),
'RestrictionParty': TypeInfo(TypeOf.Class, create:() => RestrictionParty()),
'ClientWorkerRestrictionsResponse': TypeInfo(TypeOf.Class, create:() => ClientWorkerRestrictionsResponse()),
'List<ClientWorkerRestriction>': TypeInfo(TypeOf.Class, create:() => <ClientWorkerRestriction>[]),
'List<RestrictionParty>': TypeInfo(TypeOf.Class, create:() => <RestrictionParty>[]),
'ClientWorkerRestrictionSetRequest': TypeInfo(TypeOf.Class, create:() => ClientWorkerRestrictionSetRequest()),
});
Dart ClientWorkerRestrictionSetRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/coverage/restriction HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<ClientWorkerRestrictionSetRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<BranchId>00000000-0000-0000-0000-000000000000</BranchId>
<ClientContactID>0</ClientContactID>
<Reason>String</Reason>
<RestrictionLevel>String</RestrictionLevel>
<SourceRatingID>0</SourceRatingID>
<WorkerContactID>0</WorkerContactID>
</ClientWorkerRestrictionSetRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<ClientWorkerRestrictionsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Clients>
<RestrictionParty>
<ContactId>0</ContactId>
<Name>String</Name>
</RestrictionParty>
</Clients>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
<Restrictions>
<ClientWorkerRestriction>
<BranchId>00000000-0000-0000-0000-000000000000</BranchId>
<ClientContactID>0</ClientContactID>
<ClientName>String</ClientName>
<ClientWorkerRestrictionID>0</ClientWorkerRestrictionID>
<CreatedAt>0001-01-01T00:00:00</CreatedAt>
<CreatedBy>String</CreatedBy>
<LevelLabel>String</LevelLabel>
<Reason>String</Reason>
<RestrictionLevel>String</RestrictionLevel>
<SourceRatingID>0</SourceRatingID>
<UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
<WorkerContactID>0</WorkerContactID>
<WorkerName>String</WorkerName>
</ClientWorkerRestriction>
</Restrictions>
<Workers>
<RestrictionParty>
<ContactId>0</ContactId>
<Name>String</Name>
</RestrictionParty>
</Workers>
</ClientWorkerRestrictionsResponse>