| PUT,OPTIONS | /v1/dispatch/settings/modules |
|---|
import 'package:servicestack/servicestack.dart';
class DispatchModuleView implements IConvertible
{
String? Key;
String? Mode;
bool? Allowed;
bool? Enabled;
int? InFlight;
DispatchModuleView({this.Key,this.Mode,this.Allowed,this.Enabled,this.InFlight});
DispatchModuleView.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Key = json['Key'];
Mode = json['Mode'];
Allowed = json['Allowed'];
Enabled = json['Enabled'];
InFlight = json['InFlight'];
return this;
}
Map<String, dynamic> toJson() => {
'Key': Key,
'Mode': Mode,
'Allowed': Allowed,
'Enabled': Enabled,
'InFlight': InFlight
};
getTypeName() => "DispatchModuleView";
TypeContext? context = _ctx;
}
class DispatchPatternView implements IConvertible
{
String? PatternId;
String? Name;
String? Source;
String? Facility;
String? Unit;
bool? HasQuotas;
bool? IsInverted;
int? LoadLimitMins;
String? TicketSource;
String? PayBasis;
bool? IsActive;
DispatchPatternView({this.PatternId,this.Name,this.Source,this.Facility,this.Unit,this.HasQuotas,this.IsInverted,this.LoadLimitMins,this.TicketSource,this.PayBasis,this.IsActive});
DispatchPatternView.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
PatternId = json['PatternId'];
Name = json['Name'];
Source = json['Source'];
Facility = json['Facility'];
Unit = json['Unit'];
HasQuotas = json['HasQuotas'];
IsInverted = json['IsInverted'];
LoadLimitMins = json['LoadLimitMins'];
TicketSource = json['TicketSource'];
PayBasis = json['PayBasis'];
IsActive = json['IsActive'];
return this;
}
Map<String, dynamic> toJson() => {
'PatternId': PatternId,
'Name': Name,
'Source': Source,
'Facility': Facility,
'Unit': Unit,
'HasQuotas': HasQuotas,
'IsInverted': IsInverted,
'LoadLimitMins': LoadLimitMins,
'TicketSource': TicketSource,
'PayBasis': PayBasis,
'IsActive': IsActive
};
getTypeName() => "DispatchPatternView";
TypeContext? context = _ctx;
}
class DispatchModulesResponse implements IConvertible
{
List<DispatchModuleView>? Modules = [];
List<DispatchPatternView>? Patterns = [];
ResponseStatus? ResponseStatus;
DispatchModulesResponse({this.Modules,this.Patterns,this.ResponseStatus});
DispatchModulesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Modules = JsonConverters.fromJson(json['Modules'],'List<DispatchModuleView>',context!);
Patterns = JsonConverters.fromJson(json['Patterns'],'List<DispatchPatternView>',context!);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Modules': JsonConverters.toJson(Modules,'List<DispatchModuleView>',context!),
'Patterns': JsonConverters.toJson(Patterns,'List<DispatchPatternView>',context!),
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "DispatchModulesResponse";
TypeContext? context = _ctx;
}
class DispatchModulesSaveRequest implements IConvertible
{
String? Key;
bool? Enabled;
DispatchModulesSaveRequest({this.Key,this.Enabled});
DispatchModulesSaveRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Key = json['Key'];
Enabled = json['Enabled'];
return this;
}
Map<String, dynamic> toJson() => {
'Key': Key,
'Enabled': Enabled
};
getTypeName() => "DispatchModulesSaveRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'DispatchModuleView': TypeInfo(TypeOf.Class, create:() => DispatchModuleView()),
'DispatchPatternView': TypeInfo(TypeOf.Class, create:() => DispatchPatternView()),
'DispatchModulesResponse': TypeInfo(TypeOf.Class, create:() => DispatchModulesResponse()),
'List<DispatchModuleView>': TypeInfo(TypeOf.Class, create:() => <DispatchModuleView>[]),
'List<DispatchPatternView>': TypeInfo(TypeOf.Class, create:() => <DispatchPatternView>[]),
'DispatchModulesSaveRequest': TypeInfo(TypeOf.Class, create:() => DispatchModulesSaveRequest()),
});
Dart DispatchModulesSaveRequest 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.
PUT /v1/dispatch/settings/modules HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<DispatchModulesSaveRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Enabled>false</Enabled>
<Key>String</Key>
</DispatchModulesSaveRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<DispatchModulesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Modules>
<DispatchModuleView>
<Allowed>false</Allowed>
<Enabled>false</Enabled>
<InFlight>0</InFlight>
<Key>String</Key>
<Mode>String</Mode>
</DispatchModuleView>
</Modules>
<Patterns>
<DispatchPatternView>
<Facility>String</Facility>
<HasQuotas>false</HasQuotas>
<IsActive>false</IsActive>
<IsInverted>false</IsInverted>
<LoadLimitMins>0</LoadLimitMins>
<Name>String</Name>
<PatternId>String</PatternId>
<PayBasis>String</PayBasis>
<Source>String</Source>
<TicketSource>String</TicketSource>
<Unit>String</Unit>
</DispatchPatternView>
</Patterns>
<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>
</DispatchModulesResponse>