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
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


// @DataContract
class BaseRequest implements JsonSerializable
{
    public function __construct(
        /** @description 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")
        /** @var string */
        public string $ApiKey='',

        // @DataMember
        // @ApiMember(DataType="string", Name="OAuthToken", ParameterType="header")
        /** @var string|null */
        public ?string $OAuthToken=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ApiKey'])) $this->ApiKey = $o['ApiKey'];
        if (isset($o['OAuthToken'])) $this->OAuthToken = $o['OAuthToken'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ApiKey)) $o['ApiKey'] = $this->ApiKey;
        if (isset($this->OAuthToken)) $o['OAuthToken'] = $this->OAuthToken;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class BaseResponseResult implements JsonSerializable
{
    public function __construct(
        /** @description  */
        // @DataMember
        // @ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")
        /** @var string|null */
        public ?string $StatusCode=null,

        /** @description  */
        // @DataMember
        // @ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")
        /** @var string|null */
        public ?string $Login=null,

        /** @description  */
        // @DataMember
        // @ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")
        /** @var string|null */
        public ?string $ErrorCode=null,

        /** @description  */
        // @DataMember
        // @ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")
        /** @var string|null */
        public ?string $ErrorDisplayText=null,

        /** @description  */
        // @DataMember
        // @ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")
        /** @var string|null */
        public ?string $ErrorMessage=null,

        /** @description  */
        // @DataMember
        // @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")
        /** @var string|null */
        public ?string $DomainName=null,

        /** @description  */
        // @DataMember
        // @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")
        /** @var string|null */
        public ?string $IpAddress=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['StatusCode'])) $this->StatusCode = $o['StatusCode'];
        if (isset($o['Login'])) $this->Login = $o['Login'];
        if (isset($o['ErrorCode'])) $this->ErrorCode = $o['ErrorCode'];
        if (isset($o['ErrorDisplayText'])) $this->ErrorDisplayText = $o['ErrorDisplayText'];
        if (isset($o['ErrorMessage'])) $this->ErrorMessage = $o['ErrorMessage'];
        if (isset($o['DomainName'])) $this->DomainName = $o['DomainName'];
        if (isset($o['IpAddress'])) $this->IpAddress = $o['IpAddress'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->StatusCode)) $o['StatusCode'] = $this->StatusCode;
        if (isset($this->Login)) $o['Login'] = $this->Login;
        if (isset($this->ErrorCode)) $o['ErrorCode'] = $this->ErrorCode;
        if (isset($this->ErrorDisplayText)) $o['ErrorDisplayText'] = $this->ErrorDisplayText;
        if (isset($this->ErrorMessage)) $o['ErrorMessage'] = $this->ErrorMessage;
        if (isset($this->DomainName)) $o['DomainName'] = $this->DomainName;
        if (isset($this->IpAddress)) $o['IpAddress'] = $this->IpAddress;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class BaseResponse implements JsonSerializable
{
    public function __construct(
        /** @description  */
        // @DataMember
        // @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")
        /** @var BaseResponseResult|null */
        public ?BaseResponseResult $Status=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Status'])) $this->Status = JsonConverters::from('BaseResponseResult', $o['Status']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Status)) $o['Status'] = JsonConverters::to('BaseResponseResult', $this->Status);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class AvailabilityInfo implements JsonSerializable
{
    public function __construct(
        // @DataMember
        /** @var DateTime */
        public DateTime $StartTime=new DateTime(),

        // @DataMember
        /** @var string|null */
        public ?string $StartTimeString=null,

        // @DataMember
        /** @var int */
        public int $Length=0,

        // @DataMember
        /** @var int */
        public int $InstructorId=0,

        // @DataMember
        /** @var int */
        public int $LocationId=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['StartTime'])) $this->StartTime = JsonConverters::from('DateTime', $o['StartTime']);
        if (isset($o['StartTimeString'])) $this->StartTimeString = $o['StartTimeString'];
        if (isset($o['Length'])) $this->Length = $o['Length'];
        if (isset($o['InstructorId'])) $this->InstructorId = $o['InstructorId'];
        if (isset($o['LocationId'])) $this->LocationId = $o['LocationId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->StartTime)) $o['StartTime'] = JsonConverters::to('DateTime', $this->StartTime);
        if (isset($this->StartTimeString)) $o['StartTimeString'] = $this->StartTimeString;
        if (isset($this->Length)) $o['Length'] = $this->Length;
        if (isset($this->InstructorId)) $o['InstructorId'] = $this->InstructorId;
        if (isset($this->LocationId)) $o['LocationId'] = $this->LocationId;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class DayTimeInfoObj implements JsonSerializable
{
    public function __construct(
        // @DataMember
        /** @var int */
        public int $WeekDayInt=0,

        // @DataMember
        /** @var string|null */
        public ?string $WeekDay=null,

        // @DataMember
        /** @var DateTime */
        public DateTime $StartTime=new DateTime(),

        // @DataMember
        /** @var string|null */
        public ?string $StartTimeString=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['WeekDayInt'])) $this->WeekDayInt = $o['WeekDayInt'];
        if (isset($o['WeekDay'])) $this->WeekDay = $o['WeekDay'];
        if (isset($o['StartTime'])) $this->StartTime = JsonConverters::from('DateTime', $o['StartTime']);
        if (isset($o['StartTimeString'])) $this->StartTimeString = $o['StartTimeString'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->WeekDayInt)) $o['WeekDayInt'] = $this->WeekDayInt;
        if (isset($this->WeekDay)) $o['WeekDay'] = $this->WeekDay;
        if (isset($this->StartTime)) $o['StartTime'] = JsonConverters::to('DateTime', $this->StartTime);
        if (isset($this->StartTimeString)) $o['StartTimeString'] = $this->StartTimeString;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class GroupClassInfo implements JsonSerializable
{
    public function __construct(
        // @DataMember
        /** @var array<DayTimeInfoObj>|null */
        public ?array $DayTimeInfo=null,

        // @DataMember
        /** @var DateTime */
        public DateTime $StartDate=new DateTime(),

        // @DataMember
        /** @var DateTime */
        public DateTime $EndDate=new DateTime(),

        // @DataMember
        /** @var string */
        public string $Guid='',

        // @DataMember
        /** @var int */
        public int $Length=0,

        // @DataMember
        /** @var int */
        public int $InstructorId=0,

        // @DataMember
        /** @var int */
        public int $LocationId=0,

        // @DataMember
        /** @var string|null */
        public ?string $ClassName=null,

        // @DataMember
        /** @var string|null */
        public ?string $ClassDesc=null,

        // @DataMember
        /** @var string|null */
        public ?string $ClassSummary=null,

        // @DataMember
        /** @var int */
        public int $MaxClassMembers=0,

        // @DataMember
        /** @var int */
        public int $CurrentClassMembers=0,

        // @DataMember
        /** @var string|null */
        public ?string $Notes=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['DayTimeInfo'])) $this->DayTimeInfo = JsonConverters::fromArray('DayTimeInfoObj', $o['DayTimeInfo']);
        if (isset($o['StartDate'])) $this->StartDate = JsonConverters::from('DateTime', $o['StartDate']);
        if (isset($o['EndDate'])) $this->EndDate = JsonConverters::from('DateTime', $o['EndDate']);
        if (isset($o['Guid'])) $this->Guid = $o['Guid'];
        if (isset($o['Length'])) $this->Length = $o['Length'];
        if (isset($o['InstructorId'])) $this->InstructorId = $o['InstructorId'];
        if (isset($o['LocationId'])) $this->LocationId = $o['LocationId'];
        if (isset($o['ClassName'])) $this->ClassName = $o['ClassName'];
        if (isset($o['ClassDesc'])) $this->ClassDesc = $o['ClassDesc'];
        if (isset($o['ClassSummary'])) $this->ClassSummary = $o['ClassSummary'];
        if (isset($o['MaxClassMembers'])) $this->MaxClassMembers = $o['MaxClassMembers'];
        if (isset($o['CurrentClassMembers'])) $this->CurrentClassMembers = $o['CurrentClassMembers'];
        if (isset($o['Notes'])) $this->Notes = $o['Notes'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->DayTimeInfo)) $o['DayTimeInfo'] = JsonConverters::toArray('DayTimeInfoObj', $this->DayTimeInfo);
        if (isset($this->StartDate)) $o['StartDate'] = JsonConverters::to('DateTime', $this->StartDate);
        if (isset($this->EndDate)) $o['EndDate'] = JsonConverters::to('DateTime', $this->EndDate);
        if (isset($this->Guid)) $o['Guid'] = $this->Guid;
        if (isset($this->Length)) $o['Length'] = $this->Length;
        if (isset($this->InstructorId)) $o['InstructorId'] = $this->InstructorId;
        if (isset($this->LocationId)) $o['LocationId'] = $this->LocationId;
        if (isset($this->ClassName)) $o['ClassName'] = $this->ClassName;
        if (isset($this->ClassDesc)) $o['ClassDesc'] = $this->ClassDesc;
        if (isset($this->ClassSummary)) $o['ClassSummary'] = $this->ClassSummary;
        if (isset($this->MaxClassMembers)) $o['MaxClassMembers'] = $this->MaxClassMembers;
        if (isset($this->CurrentClassMembers)) $o['CurrentClassMembers'] = $this->CurrentClassMembers;
        if (isset($this->Notes)) $o['Notes'] = $this->Notes;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class TimeIncrementByInstructor implements JsonSerializable
{
    public function __construct(
        // @DataMember
        /** @var int */
        public int $InstructorId=0,

        // @DataMember
        /** @var int */
        public int $TimeIncrement=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['InstructorId'])) $this->InstructorId = $o['InstructorId'];
        if (isset($o['TimeIncrement'])) $this->TimeIncrement = $o['TimeIncrement'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->InstructorId)) $o['InstructorId'] = $this->InstructorId;
        if (isset($this->TimeIncrement)) $o['TimeIncrement'] = $this->TimeIncrement;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class GetSchedulingCalendarResponse extends BaseResponse implements JsonSerializable
{
    /**
     * @param BaseResponseResult|null $Status
     */
    public function __construct(
        ?BaseResponseResult $Status=null,
        // @DataMember
        /** @var array<AvailabilityInfo>|null */
        public ?array $Availabilities=null,

        // @DataMember
        /** @var array<GroupClassInfo>|null */
        public ?array $GroupClasses=null,

        // @DataMember
        /** @var int */
        public int $TimeIncrement=0,

        // @DataMember
        /** @var array<TimeIncrementByInstructor>|null */
        public ?array $TimeIncrementsByInstructor=null
    ) {
        parent::__construct($Status);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Availabilities'])) $this->Availabilities = JsonConverters::fromArray('AvailabilityInfo', $o['Availabilities']);
        if (isset($o['GroupClasses'])) $this->GroupClasses = JsonConverters::fromArray('GroupClassInfo', $o['GroupClasses']);
        if (isset($o['TimeIncrement'])) $this->TimeIncrement = $o['TimeIncrement'];
        if (isset($o['TimeIncrementsByInstructor'])) $this->TimeIncrementsByInstructor = JsonConverters::fromArray('TimeIncrementByInstructor', $o['TimeIncrementsByInstructor']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Availabilities)) $o['Availabilities'] = JsonConverters::toArray('AvailabilityInfo', $this->Availabilities);
        if (isset($this->GroupClasses)) $o['GroupClasses'] = JsonConverters::toArray('GroupClassInfo', $this->GroupClasses);
        if (isset($this->TimeIncrement)) $o['TimeIncrement'] = $this->TimeIncrement;
        if (isset($this->TimeIncrementsByInstructor)) $o['TimeIncrementsByInstructor'] = JsonConverters::toArray('TimeIncrementByInstructor', $this->TimeIncrementsByInstructor);
        return empty($o) ? new class(){} : $o;
    }
}

/** @description GetSchedulingCalendarRequires active-e Lesson Scheduling Service. This API call was accidentally named GetSchedulingCalender in the past. */
// @DataContract
class GetSchedulingCalendarRequest extends BaseRequest implements JsonSerializable
{
    /**
     * @param string $ApiKey
     * @param string|null $OAuthToken
     */
    public function __construct(
        string $ApiKey='',
        ?string $OAuthToken=null,
        /** @description 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")
        /** @var int */
        public int $TypeId=0,

        /** @description 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")
        /** @var string|null */
        public ?string $DateFrom=null,

        /** @description 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")
        /** @var string|null */
        public ?string $DateTo=null,

        /** @description 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")
        /** @var int|null */
        public ?int $InstructorId=null,

        /** @description 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")
        /** @var int|null */
        public ?int $LocationId=null
    ) {
        parent::__construct($ApiKey,$OAuthToken);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['TypeId'])) $this->TypeId = $o['TypeId'];
        if (isset($o['DateFrom'])) $this->DateFrom = $o['DateFrom'];
        if (isset($o['DateTo'])) $this->DateTo = $o['DateTo'];
        if (isset($o['InstructorId'])) $this->InstructorId = $o['InstructorId'];
        if (isset($o['LocationId'])) $this->LocationId = $o['LocationId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->TypeId)) $o['TypeId'] = $this->TypeId;
        if (isset($this->DateFrom)) $o['DateFrom'] = $this->DateFrom;
        if (isset($this->DateTo)) $o['DateTo'] = $this->DateTo;
        if (isset($this->InstructorId)) $o['InstructorId'] = $this->InstructorId;
        if (isset($this->LocationId)) $o['LocationId'] = $this->LocationId;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetSchedulingCalendarRequest 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/GetSchedulingCalendar HTTP/1.1 
Host: active-ewebservice.biz 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Availabilities":[{"StartTimeString":"1/1/0001 12:00:00 AM","Length":0,"InstructorId":0,"LocationId":0}],"GroupClasses":[{"DayTimeInfo":[{"WeekDayInt":0,"WeekDay":"String","StartTimeString":"1/1/0001 12:00:00 AM"}],"Guid":"00000000000000000000000000000000","Length":0,"InstructorId":0,"LocationId":0,"ClassName":"String","ClassDesc":"String","ClassSummary":"String","MaxClassMembers":0,"CurrentClassMembers":0,"Notes":"String"}],"TimeIncrement":0,"TimeIncrementsByInstructor":[{"InstructorId":0,"TimeIncrement":0}],"Status":{"StatusCode":"String","Login":"String","ErrorCode":"String","ErrorDisplayText":"String","ErrorMessage":"String","DomainName":"String","IpAddress":"String"}}