| GET,OPTIONS | /v1/ReportManager/api/Objects/{Table}/fields |
|---|
import Foundation
import ServiceStack
public class ReportManagerObjectFieldsRequest : ReportManagerRequest<ReportManagerObject>
{
public var table:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case table
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
table = try container.decodeIfPresent(String.self, forKey: .table)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if table != nil { try container.encode(table, forKey: .table) }
}
}
public class ReportManagerRequest<T : Codable> : Codable
{
required public init(){}
}
// @DataContract
public class ReportManagerObject : IReportManagerDocument, Codable
{
// @DataMember(Name="id")
public var id:String
// @DataMember(Name="name")
public var name:String
// @DataMember(Name="data")
public var data:[ReportManagerObjectData] = []
// @DataMember(Name="refs")
public var refs:[ReportManagerObjectRef] = []
required public init(){}
}
// @DataContract
public class ReportManagerObjectData : Codable
{
// @DataMember(Name="id")
public var id:String
// @DataMember(Name="name")
public var name:String
// @DataMember(Name="filter")
public var filter:Bool
// @DataMember(Name="edit")
public var edit:Bool
// @DataMember(Name="type")
public var type:String
// @DataMember(Name="ref")
public var ref:String
// @DataMember(Name="key")
public var key:Bool
// @DataMember(Name="show")
public var show:Bool
required public init(){}
}
// @DataContract
public class ReportManagerObjectRef : Codable
{
// @DataMember(Name="id")
public var id:Int
// @DataMember(Name="target")
public var target:String
// @DataMember(Name="source")
public var source:String
// @DataMember(Name="name")
public var name:String
required public init(){}
}
Swift ReportManagerObjectFieldsRequest 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.
GET /v1/ReportManager/api/Objects/{Table}/fields HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
[{"id":"String","name":"String","data":[{"id":"String","name":"String","filter":false,"edit":false,"type":"String","ref":"String","key":false,"show":false}],"refs":[{"id":0,"target":"String","source":"String","name":"String"}]}]