AIM Web Services

<back to all web services

GetSchedulingInstructorsRequest

GetSchedulingInstructors
Requires active-e Lesson Scheduling Service

The following routes are available for this service:
GET/api/GetSchedulingInstructors
import Foundation
import ServiceStack

/**
* GetSchedulingInstructorsRequires active-e Lesson Scheduling Service
*/
// @DataContract
public class GetSchedulingInstructorsRequest : BaseRequest
{
    /**
    * Instructor ID to lookup. If sent, other parameters will be ignored.
    */
    // @DataMember
    // @ApiMember(DataType="integer", Description="Instructor ID to lookup. If sent, other parameters will be ignored.", Format="int32", Name="InstructorId", ParameterType="query")
    public var instructorId:Int?

    /**
    * If sent, only instructors who teach lessons with the passed grouping will be returned.
    */
    // @DataMember
    // @ApiMember(DataType="integer", Description="If sent, only instructors who teach lessons with the passed grouping will be returned.", Format="int64", Name="GroupingId", ParameterType="query")
    public var groupingId:Int?

    /**
    * If sent, only instructors who teach lessons with the passed type will be returned.
    */
    // @DataMember
    // @ApiMember(DataType="integer", Description="If sent, only instructors who teach lessons with the passed type will be returned.", Format="int64", Name="TypeId", ParameterType="query")
    public var typeId:Int?

    /**
    * If sent, only instructors who have an availability record at the passed location will be returned.
    */
    // @DataMember
    // @ApiMember(DataType="integer", Description="If sent, only instructors who have an availability record at the passed location will be returned.", Format="int64", Name="LocationId", ParameterType="query")
    public var locationId:Int?

    /**
    * If true, basic Availability Info will be included in the response
    */
    // @DataMember
    // @ApiMember(DataType="boolean", Description="If true, basic Availability Info will be included in the response", Name="IncludeAvailabilityInfo", ParameterType="query")
    public var includeAvailabilityInfo:Bool

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case instructorId
        case groupingId
        case typeId
        case locationId
        case includeAvailabilityInfo
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        instructorId = try container.decodeIfPresent(Int.self, forKey: .instructorId)
        groupingId = try container.decodeIfPresent(Int.self, forKey: .groupingId)
        typeId = try container.decodeIfPresent(Int.self, forKey: .typeId)
        locationId = try container.decodeIfPresent(Int.self, forKey: .locationId)
        includeAvailabilityInfo = try container.decodeIfPresent(Bool.self, forKey: .includeAvailabilityInfo)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if instructorId != nil { try container.encode(instructorId, forKey: .instructorId) }
        if groupingId != nil { try container.encode(groupingId, forKey: .groupingId) }
        if typeId != nil { try container.encode(typeId, forKey: .typeId) }
        if locationId != nil { try container.encode(locationId, forKey: .locationId) }
        if includeAvailabilityInfo != nil { try container.encode(includeAvailabilityInfo, forKey: .includeAvailabilityInfo) }
    }
}

// @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 GetSchedulingInstructorsResponse : BaseResponse
{
    // @DataMember
    public var instructors:[InstructorInfo] = []

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case instructors
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        instructors = try container.decodeIfPresent([InstructorInfo].self, forKey: .instructors) ?? []
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if instructors.count > 0 { try container.encode(instructors, forKey: .instructors) }
    }
}

// @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 InstructorInfo : Codable
{
    // @DataMember
    public var id:Int

    // @DataMember
    public var name:String

    // @DataMember
    public var email:String

    // @DataMember
    public var topic:String

    // @DataMember
    public var availabilityInfo:InstructorAvailabilityInfo

    required public init(){}
}

public class InstructorAvailabilityInfo : Codable
{
    // @DataMember
    public var sunday:Bool

    // @DataMember
    public var monday:Bool

    // @DataMember
    public var tuesday:Bool

    // @DataMember
    public var wednesday:Bool

    // @DataMember
    public var thursday:Bool

    // @DataMember
    public var friday:Bool

    // @DataMember
    public var saturday:Bool

    required public init(){}
}


Swift GetSchedulingInstructorsRequest 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

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /api/GetSchedulingInstructors HTTP/1.1 
Host: active-ewebservice.biz 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Instructors":[{"Id":0,"Name":"String","Email":"String","Topic":"String","AvailabilityInfo":{"Sunday":false,"Monday":false,"Tuesday":false,"Wednesday":false,"Thursday":false,"Friday":false,"Saturday":false}}],"Status":{"StatusCode":"String","Login":"String","ErrorCode":"String","ErrorDisplayText":"String","ErrorMessage":"String","DomainName":"String","IpAddress":"String"}}