| POST,OPTIONS | /v1/territory/agreementneeds |
|---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class Territory implements IConvertible
{
int? TerritoryID;
String? TerritoryUID;
String? Name;
String? Color;
String? ZipCsv;
int? CrewID;
String? CrewName;
bool? Active;
Territory({this.TerritoryID,this.TerritoryUID,this.Name,this.Color,this.ZipCsv,this.CrewID,this.CrewName,this.Active});
Territory.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
TerritoryID = json['TerritoryID'];
TerritoryUID = json['TerritoryUID'];
Name = json['Name'];
Color = json['Color'];
ZipCsv = json['ZipCsv'];
CrewID = json['CrewID'];
CrewName = json['CrewName'];
Active = json['Active'];
return this;
}
Map<String, dynamic> toJson() => {
'TerritoryID': TerritoryID,
'TerritoryUID': TerritoryUID,
'Name': Name,
'Color': Color,
'ZipCsv': ZipCsv,
'CrewID': CrewID,
'CrewName': CrewName,
'Active': Active
};
getTypeName() => "Territory";
TypeContext? context = _ctx;
}
class TerritoryPropertyRow implements IConvertible
{
int? TerritoryID;
int? AgreementID;
TerritoryPropertyRow({this.TerritoryID,this.AgreementID});
TerritoryPropertyRow.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
TerritoryID = json['TerritoryID'];
AgreementID = json['AgreementID'];
return this;
}
Map<String, dynamic> toJson() => {
'TerritoryID': TerritoryID,
'AgreementID': AgreementID
};
getTypeName() => "TerritoryPropertyRow";
TypeContext? context = _ctx;
}
class CrewEquipmentRow implements IConvertible
{
int? CrewID;
int? EquipmentID;
String? EquipmentName;
CrewEquipmentRow({this.CrewID,this.EquipmentID,this.EquipmentName});
CrewEquipmentRow.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CrewID = json['CrewID'];
EquipmentID = json['EquipmentID'];
EquipmentName = json['EquipmentName'];
return this;
}
Map<String, dynamic> toJson() => {
'CrewID': CrewID,
'EquipmentID': EquipmentID,
'EquipmentName': EquipmentName
};
getTypeName() => "CrewEquipmentRow";
TypeContext? context = _ctx;
}
class AgreementNeedRow implements IConvertible
{
int? AgreementID;
int? EquipmentID;
String? EquipmentName;
AgreementNeedRow({this.AgreementID,this.EquipmentID,this.EquipmentName});
AgreementNeedRow.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
AgreementID = json['AgreementID'];
EquipmentID = json['EquipmentID'];
EquipmentName = json['EquipmentName'];
return this;
}
Map<String, dynamic> toJson() => {
'AgreementID': AgreementID,
'EquipmentID': EquipmentID,
'EquipmentName': EquipmentName
};
getTypeName() => "AgreementNeedRow";
TypeContext? context = _ctx;
}
class TerritoryResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
List<Territory>? Territories = [];
List<TerritoryPropertyRow>? Properties = [];
List<CrewEquipmentRow>? CrewEquipment = [];
List<AgreementNeedRow>? AgreementNeeds = [];
TerritoryResponse({this.ResponseStatus,this.Territories,this.Properties,this.CrewEquipment,this.AgreementNeeds});
TerritoryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
Territories = JsonConverters.fromJson(json['Territories'],'List<Territory>',context!);
Properties = JsonConverters.fromJson(json['Properties'],'List<TerritoryPropertyRow>',context!);
CrewEquipment = JsonConverters.fromJson(json['CrewEquipment'],'List<CrewEquipmentRow>',context!);
AgreementNeeds = JsonConverters.fromJson(json['AgreementNeeds'],'List<AgreementNeedRow>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'Territories': JsonConverters.toJson(Territories,'List<Territory>',context!),
'Properties': JsonConverters.toJson(Properties,'List<TerritoryPropertyRow>',context!),
'CrewEquipment': JsonConverters.toJson(CrewEquipment,'List<CrewEquipmentRow>',context!),
'AgreementNeeds': JsonConverters.toJson(AgreementNeeds,'List<AgreementNeedRow>',context!)
};
getTypeName() => "TerritoryResponse";
TypeContext? context = _ctx;
}
class AgreementNeedsSetRequest implements IConvertible
{
int? AgreementID;
List<int>? EquipmentIDs = [];
AgreementNeedsSetRequest({this.AgreementID,this.EquipmentIDs});
AgreementNeedsSetRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
AgreementID = json['AgreementID'];
EquipmentIDs = JsonConverters.fromJson(json['EquipmentIDs'],'List<int>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'AgreementID': AgreementID,
'EquipmentIDs': JsonConverters.toJson(EquipmentIDs,'List<int>',context!)
};
getTypeName() => "AgreementNeedsSetRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'Territory': TypeInfo(TypeOf.Class, create:() => Territory()),
'TerritoryPropertyRow': TypeInfo(TypeOf.Class, create:() => TerritoryPropertyRow()),
'CrewEquipmentRow': TypeInfo(TypeOf.Class, create:() => CrewEquipmentRow()),
'AgreementNeedRow': TypeInfo(TypeOf.Class, create:() => AgreementNeedRow()),
'TerritoryResponse': TypeInfo(TypeOf.Class, create:() => TerritoryResponse()),
'List<Territory>': TypeInfo(TypeOf.Class, create:() => <Territory>[]),
'List<TerritoryPropertyRow>': TypeInfo(TypeOf.Class, create:() => <TerritoryPropertyRow>[]),
'List<CrewEquipmentRow>': TypeInfo(TypeOf.Class, create:() => <CrewEquipmentRow>[]),
'List<AgreementNeedRow>': TypeInfo(TypeOf.Class, create:() => <AgreementNeedRow>[]),
'AgreementNeedsSetRequest': TypeInfo(TypeOf.Class, create:() => AgreementNeedsSetRequest()),
});
Dart AgreementNeedsSetRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/territory/agreementneeds HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"AgreementID":0,"EquipmentIDs":[0]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Territories":[{"TerritoryID":0,"TerritoryUID":"String","Name":"String","Color":"String","ZipCsv":"String","CrewID":0,"CrewName":"String","Active":false}],"Properties":[{"TerritoryID":0,"AgreementID":0}],"CrewEquipment":[{"CrewID":0,"EquipmentID":0,"EquipmentName":"String"}],"AgreementNeeds":[{"AgreementID":0,"EquipmentID":0,"EquipmentName":"String"}]}