GET | /api/GetSchedulingClassInfo |
---|
import Foundation
import ServiceStack
/**
* GetSchedulingClassInfoRequires active-e Lesson Scheduling Service
*/
// @DataContract
public class GetSchedulingClassInfoRequest : BaseRequest
{
/**
* Class ID to look up.
*/
// @DataMember
// @ApiMember(DataType="string", Description="Class ID to look up.", IsRequired=true, Name="ClassId", ParameterType="query")
public var classId:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case classId
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
classId = try container.decodeIfPresent(String.self, forKey: .classId)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if classId != nil { try container.encode(classId, forKey: .classId) }
}
}
// @DataContract
public class BaseRequest : Codable
{
/**
* This is your AIM API Key provided by Tri-Tech
*/
// @DataMember
// @ApiMember(DataType="string", Description="This is your AIM API Key provided by Tri-Tech", IsRequired=true, Name="ApiKey", ParameterType="header")
public var apiKey:String
// @DataMember
// @ApiMember(DataType="string", Name="OAuthToken", ParameterType="header")
public var oAuthToken:String
required public init(){}
}
// @DataContract
public class GetSchedulingGroupingsResponse : BaseResponse
{
// @DataMember
public var groupings:[GroupingInfo] = []
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case groupings
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
groupings = try container.decodeIfPresent([GroupingInfo].self, forKey: .groupings) ?? []
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if groupings.count > 0 { try container.encode(groupings, forKey: .groupings) }
}
}
// @DataContract
public class BaseResponse : Codable
{
/**
*
*/
// @DataMember
// @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")
public var status:BaseResponseResult
required public init(){}
}
// @DataContract
public class BaseResponseResult : Codable
{
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")
public var statusCode:String
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")
public var login:String
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")
public var errorCode:String
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")
public var errorDisplayText:String
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")
public var errorMessage:String
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")
public var domainName:String
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")
public var ipAddress:String
required public init(){}
}
// @DataContract
public class GroupingInfo : Codable
{
// @DataMember
public var id:Int
// @DataMember
public var desc:String
required public init(){}
}
Swift GetSchedulingClassInfoRequest 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 /api/GetSchedulingClassInfo HTTP/1.1 Host: active-ewebservice.biz Accept: application/json
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"Groupings":[{"Id":0,"Desc":"String"}],"Status":{"StatusCode":"String","Login":"String","ErrorCode":"String","ErrorDisplayText":"String","ErrorMessage":"String","DomainName":"String","IpAddress":"String"}}