GET | /api/GetSchedulingTypes |
---|
import Foundation
import ServiceStack
/**
* GetSchedulingTypesRequires active-e Lesson Scheduling Service
*/
// @DataContract
public class GetSchedulingTypesRequest : BaseRequest
{
/**
* Type ID to look up. If sent, all other parameters will be ignored.
*/
// @DataMember
// @ApiMember(DataType="integer", Description="Type ID to look up. If sent, all other parameters will be ignored.", Format="int64", Name="TypeId", ParameterType="query")
public var typeId:Int?
/**
* If sent, only types in the sent grouping will be returned.
*/
// @DataMember
// @ApiMember(DataType="integer", Description="If sent, only types in the sent grouping will be returned.", Format="int64", Name="GroupingId", ParameterType="query")
public var groupingId:Int?
/**
* If sent, only types taught by the sent instructor will be returned.
*/
// @DataMember
// @ApiMember(DataType="integer", Description="If sent, only types taught by the sent instructor will be returned.", Format="int32", Name="InstructorId", ParameterType="query")
public var instructorId:Int?
/**
* If sent, only types taught at the sent location will be returned.
*/
// @DataMember
// @ApiMember(DataType="integer", Description="If sent, only types taught at the sent location will be returned.", Format="int64", Name="LocationId", ParameterType="query")
public var locationId:Int?
/**
* If sent, should be Private or Group. If Private, only Private Lesson Types will be returned. If Group, only Group Lesson Types will be returned.
*/
// @DataMember
// @ApiMember(DataType="integer", Description="If sent, should be Private or Group. If Private, only Private Lesson Types will be returned. If Group, only Group Lesson Types will be returned.", Format="int64", Name="MembershipType", ParameterType="query")
public var membershipType:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case typeId
case groupingId
case instructorId
case locationId
case membershipType
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
typeId = try container.decodeIfPresent(Int.self, forKey: .typeId)
groupingId = try container.decodeIfPresent(Int.self, forKey: .groupingId)
instructorId = try container.decodeIfPresent(Int.self, forKey: .instructorId)
locationId = try container.decodeIfPresent(Int.self, forKey: .locationId)
membershipType = try container.decodeIfPresent(String.self, forKey: .membershipType)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if typeId != nil { try container.encode(typeId, forKey: .typeId) }
if groupingId != nil { try container.encode(groupingId, forKey: .groupingId) }
if instructorId != nil { try container.encode(instructorId, forKey: .instructorId) }
if locationId != nil { try container.encode(locationId, forKey: .locationId) }
if membershipType != nil { try container.encode(membershipType, forKey: .membershipType) }
}
}
// @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 GetSchedulingTypesResponse : BaseResponse
{
// @DataMember
public var types:[TypeInfo] = []
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case types
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
types = try container.decodeIfPresent([TypeInfo].self, forKey: .types) ?? []
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if types.count > 0 { try container.encode(types, forKey: .types) }
}
}
// @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 TypeInfo : Codable
{
// @DataMember
public var id:Int
// @DataMember
public var desc:String
// @DataMember
public var length:Int
// @DataMember
public var topic:String
// @DataMember
public var recurranceType:String
// @DataMember
public var membershipType:String
// @DataMember
public var rate:Double
// @DataMember
public var groupingId:Int?
// @DataMember
public var groupingDesc:String
required public init(){}
}
Swift GetSchedulingTypesRequest 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.
GET /api/GetSchedulingTypes HTTP/1.1 Host: active-ewebservice.biz Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <GetSchedulingTypesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService"> <Status> <DomainName>String</DomainName> <ErrorCode>String</ErrorCode> <ErrorDisplayText>String</ErrorDisplayText> <ErrorMessage>String</ErrorMessage> <IpAddress>String</IpAddress> <Login>String</Login> <StatusCode>String</StatusCode> </Status> <Types> <GetSchedulingTypesResponse.TypeInfo> <Desc>String</Desc> <GroupingDesc>String</GroupingDesc> <GroupingId>0</GroupingId> <Id>0</Id> <Length>0</Length> <MembershipType>String</MembershipType> <Rate>0</Rate> <RecurranceType>String</RecurranceType> <Topic>String</Topic> </GetSchedulingTypesResponse.TypeInfo> </Types> </GetSchedulingTypesResponse>