AIM Web Services

<back to all web services

GetSchedulingGroupingsRequest

GetSchedulingGroupings
Requires active-e Lesson Scheduling Service

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

/**
* GetSchedulingGroupingsRequires active-e Lesson Scheduling Service
*/
// @DataContract
public class GetSchedulingGroupingsRequest : BaseRequest
{
    /**
    * Grouping ID to look up. If sent, all other parameters will be ignored.
    */
    // @DataMember
    // @ApiMember(DataType="integer", Description="Grouping ID to look up. If sent, all other parameters will be ignored.", Format="int64", Name="GroupingId", ParameterType="query")
    public var groupingId:Int?

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

    /**
    * If sent, only groupings taught at the sent location will be returned.
    */
    // @DataMember
    // @ApiMember(DataType="integer", Description="If sent, only groupings 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 groupings containing Private Lesson Types will be returned. If Group, only groupings containing Group Lesson Types will be returned.
    */
    // @DataMember
    // @ApiMember(DataType="integer", Description="If sent, should be Private or Group. If Private, only groupings containing Private Lesson Types will be returned. If Group, only groupings containing 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 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)
        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 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 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 GetSchedulingGroupingsRequest DTOs

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

HTTP + OTHER

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

GET /api/GetSchedulingGroupings HTTP/1.1 
Host: active-ewebservice.biz 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Groupings":[{"Id":0,"Desc":"String"}],"Status":{"StatusCode":"String","Login":"String","ErrorCode":"String","ErrorDisplayText":"String","ErrorMessage":"String","DomainName":"String","IpAddress":"String"}}