AIM Web Services

<back to all web services

GetSchedulingCalendarRequest

GetSchedulingCalendar
Requires active-e Lesson Scheduling Service. This API call was accidentally named GetSchedulingCalender in the past.

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

/**
* GetSchedulingCalendarRequires active-e Lesson Scheduling Service. This API call was accidentally named GetSchedulingCalender in the past.
*/
// @DataContract
public class GetSchedulingCalendarRequest : BaseRequest
{
    /**
    * The type of lessons to get a schedule for.
    */
    // @DataMember
    // @ApiMember(DataType="integer", Description="The type of lessons to get a schedule for.", Format="int64", IsRequired=true, Name="TypeId", ParameterType="query")
    public var typeId:Int

    /**
    * If sent, lessons from this date/time onward will be returned. Otherwise the current date/time is used.
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="If sent, lessons from this date/time onward will be returned. Otherwise the current date/time is used.", Format="date", Name="DateFrom", ParameterType="query")
    public var dateFrom:String

    /**
    * If sent, lessons from before this date/time will be returned. Otherwise the DateFrom plus one week is used.
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="If sent, lessons from before this date/time will be returned. Otherwise the DateFrom plus one week is used.", Format="date", Name="DateTo", ParameterType="query")
    public var dateTo:String

    /**
    * If sent, only lessons taught by the sent instructor will be returned.
    */
    // @DataMember
    // @ApiMember(DataType="integer", Description="If sent, only lessons taught by the sent instructor will be returned.", Format="int32", Name="InstructorId", ParameterType="query")
    public var instructorId:Int?

    /**
    * If sent, lessons taught at the sent location will be returned.
    */
    // @DataMember
    // @ApiMember(DataType="integer", Description="If sent, lessons taught at the sent location will be returned.", Format="int64", Name="LocationId", ParameterType="query")
    public var locationId:Int?

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

    private enum CodingKeys : String, CodingKey {
        case typeId
        case dateFrom
        case dateTo
        case instructorId
        case locationId
    }

    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)
        dateFrom = try container.decodeIfPresent(String.self, forKey: .dateFrom)
        dateTo = try container.decodeIfPresent(String.self, forKey: .dateTo)
        instructorId = try container.decodeIfPresent(Int.self, forKey: .instructorId)
        locationId = try container.decodeIfPresent(Int.self, forKey: .locationId)
    }

    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 dateFrom != nil { try container.encode(dateFrom, forKey: .dateFrom) }
        if dateTo != nil { try container.encode(dateTo, forKey: .dateTo) }
        if instructorId != nil { try container.encode(instructorId, forKey: .instructorId) }
        if locationId != nil { try container.encode(locationId, forKey: .locationId) }
    }
}

// @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 GetSchedulingCalendarResponse : BaseResponse
{
    // @DataMember
    public var availabilities:[AvailabilityInfo] = []

    // @DataMember
    public var groupClasses:[GroupClassInfo] = []

    // @DataMember
    public var timeIncrement:Int

    // @DataMember
    public var timeIncrementsByInstructor:[TimeIncrementByInstructor] = []

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

    private enum CodingKeys : String, CodingKey {
        case availabilities
        case groupClasses
        case timeIncrement
        case timeIncrementsByInstructor
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        availabilities = try container.decodeIfPresent([AvailabilityInfo].self, forKey: .availabilities) ?? []
        groupClasses = try container.decodeIfPresent([GroupClassInfo].self, forKey: .groupClasses) ?? []
        timeIncrement = try container.decodeIfPresent(Int.self, forKey: .timeIncrement)
        timeIncrementsByInstructor = try container.decodeIfPresent([TimeIncrementByInstructor].self, forKey: .timeIncrementsByInstructor) ?? []
    }

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

// @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 AvailabilityInfo : Codable
{
    // @DataMember
    public var startTime:Date

    // @DataMember
    public var startTimeString:String

    // @DataMember
    public var length:Int

    // @DataMember
    public var instructorId:Int

    // @DataMember
    public var locationId:Int

    required public init(){}
}

// @DataContract
public class GroupClassInfo : Codable
{
    // @DataMember
    public var dayTimeInfo:[DayTimeInfoObj] = []

    // @DataMember
    public var startDate:Date

    // @DataMember
    public var endDate:Date

    // @DataMember
    public var guid:String

    // @DataMember
    public var length:Int

    // @DataMember
    public var instructorId:Int

    // @DataMember
    public var locationId:Int

    // @DataMember
    public var className:String

    // @DataMember
    public var classDesc:String

    // @DataMember
    public var classSummary:String

    // @DataMember
    public var maxClassMembers:Int

    // @DataMember
    public var currentClassMembers:Int

    // @DataMember
    public var notes:String

    required public init(){}
}

// @DataContract
public class DayTimeInfoObj : Codable
{
    // @DataMember
    public var weekDayInt:Int

    // @DataMember
    public var weekDay:String

    // @DataMember
    public var startTime:Date

    // @DataMember
    public var startTimeString:String

    required public init(){}
}

// @DataContract
public class TimeIncrementByInstructor : Codable
{
    // @DataMember
    public var instructorId:Int

    // @DataMember
    public var timeIncrement:Int

    required public init(){}
}


Swift GetSchedulingCalendarRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

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

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

<GetSchedulingCalendarResponse 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>
  <Availabilities>
    <GetSchedulingCalendarResponse.AvailabilityInfo>
      <InstructorId>0</InstructorId>
      <Length>0</Length>
      <LocationId>0</LocationId>
      <StartTime>0001-01-01T00:00:00</StartTime>
      <StartTimeString>1/1/0001 12:00:00 AM</StartTimeString>
    </GetSchedulingCalendarResponse.AvailabilityInfo>
  </Availabilities>
  <GroupClasses>
    <GetSchedulingCalendarResponse.GroupClassInfo>
      <ClassDesc>String</ClassDesc>
      <ClassName>String</ClassName>
      <ClassSummary>String</ClassSummary>
      <CurrentClassMembers>0</CurrentClassMembers>
      <DayTimeInfo>
        <GetSchedulingCalendarResponse.DayTimeInfoObj>
          <StartTime>0001-01-01T00:00:00</StartTime>
          <StartTimeString>1/1/0001 12:00:00 AM</StartTimeString>
          <WeekDay>String</WeekDay>
          <WeekDayInt>0</WeekDayInt>
        </GetSchedulingCalendarResponse.DayTimeInfoObj>
      </DayTimeInfo>
      <EndDate>0001-01-01T00:00:00</EndDate>
      <Guid>00000000-0000-0000-0000-000000000000</Guid>
      <InstructorId>0</InstructorId>
      <Length>0</Length>
      <LocationId>0</LocationId>
      <MaxClassMembers>0</MaxClassMembers>
      <Notes>String</Notes>
      <StartDate>0001-01-01T00:00:00</StartDate>
    </GetSchedulingCalendarResponse.GroupClassInfo>
  </GroupClasses>
  <TimeIncrement>0</TimeIncrement>
  <TimeIncrementsByInstructor>
    <GetSchedulingCalendarResponse.TimeIncrementByInstructor>
      <InstructorId>0</InstructorId>
      <TimeIncrement>0</TimeIncrement>
    </GetSchedulingCalendarResponse.TimeIncrementByInstructor>
  </TimeIncrementsByInstructor>
</GetSchedulingCalendarResponse>