| POST,OPTIONS | /v1/territory/agreementneeds |
|---|
import Foundation
import ServiceStack
public class AgreementNeedsSetRequest : Codable
{
public var agreementID:Int
public var equipmentIDs:[Int] = []
required public init(){}
}
public class TerritoryResponse : Codable
{
public var responseStatus:ResponseStatus
public var territories:[Territory] = []
public var properties:[TerritoryPropertyRow] = []
public var crewEquipment:[CrewEquipmentRow] = []
public var agreementNeeds:[AgreementNeedRow] = []
required public init(){}
}
public class Territory : Codable
{
public var territoryID:Int
public var territoryUID:String
public var name:String
public var color:String
public var zipCsv:String
public var crewID:Int?
public var crewName:String
public var active:Bool
required public init(){}
}
public class TerritoryPropertyRow : Codable
{
public var territoryID:Int
public var agreementID:Int
required public init(){}
}
public class CrewEquipmentRow : Codable
{
public var crewID:Int
public var equipmentID:Int
public var equipmentName:String
required public init(){}
}
public class AgreementNeedRow : Codable
{
public var agreementID:Int
public var equipmentID:Int
public var equipmentName:String
required public init(){}
}
Swift AgreementNeedsSetRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
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: text/jsv
Content-Type: text/jsv
Content-Length: length
{
AgreementID: 0,
EquipmentIDs:
[
0
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
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
}
]
}