regis

<back to all web services

SectionsTimetableRequest

Requires Authentication
Required permission:ReadSections
The following routes are available for this service:
POST/Sections/Timetable/{reporting_term}
<?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};


class SectionTimetableNoteResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $heading=null,
        /** @var string|null */
        public ?string $body=null
    ) {
    }

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

class SectionTimetableInstructorResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $instructorName=null,
        /** @var string|null */
        public ?string $instructorSlug=null
    ) {
    }

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

class SectionTimetableResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $time=null,
        /** @var int|null */
        public ?int $sortTime=null,
        /** @var string|null */
        public ?string $course=null,
        /** @var string|null */
        public ?string $courseSlug=null,
        /** @var string|null */
        public ?string $desc=null,
        /** @var array<SectionTimetableInstructorResponse>|null */
        public ?array $instructors=null,
        /** @var string|null */
        public ?string $registrationInfo=null,
        /** @var string|null */
        public ?string $room=null,
        /** @var float */
        public float $creditMinimum=0.0,
        /** @var float */
        public float $creditMaximum=0.0,
        /** @var float */
        public float $auditMinimum=0.0,
        /** @var float */
        public float $auditMaximum=0.0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['time'])) $this->time = $o['time'];
        if (isset($o['sortTime'])) $this->sortTime = $o['sortTime'];
        if (isset($o['course'])) $this->course = $o['course'];
        if (isset($o['courseSlug'])) $this->courseSlug = $o['courseSlug'];
        if (isset($o['desc'])) $this->desc = $o['desc'];
        if (isset($o['instructors'])) $this->instructors = JsonConverters::fromArray('SectionTimetableInstructorResponse', $o['instructors']);
        if (isset($o['registrationInfo'])) $this->registrationInfo = $o['registrationInfo'];
        if (isset($o['room'])) $this->room = $o['room'];
        if (isset($o['creditMinimum'])) $this->creditMinimum = $o['creditMinimum'];
        if (isset($o['creditMaximum'])) $this->creditMaximum = $o['creditMaximum'];
        if (isset($o['auditMinimum'])) $this->auditMinimum = $o['auditMinimum'];
        if (isset($o['auditMaximum'])) $this->auditMaximum = $o['auditMaximum'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->time)) $o['time'] = $this->time;
        if (isset($this->sortTime)) $o['sortTime'] = $this->sortTime;
        if (isset($this->course)) $o['course'] = $this->course;
        if (isset($this->courseSlug)) $o['courseSlug'] = $this->courseSlug;
        if (isset($this->desc)) $o['desc'] = $this->desc;
        if (isset($this->instructors)) $o['instructors'] = JsonConverters::toArray('SectionTimetableInstructorResponse', $this->instructors);
        if (isset($this->registrationInfo)) $o['registrationInfo'] = $this->registrationInfo;
        if (isset($this->room)) $o['room'] = $this->room;
        if (isset($this->creditMinimum)) $o['creditMinimum'] = $this->creditMinimum;
        if (isset($this->creditMaximum)) $o['creditMaximum'] = $this->creditMaximum;
        if (isset($this->auditMinimum)) $o['auditMinimum'] = $this->auditMinimum;
        if (isset($this->auditMaximum)) $o['auditMaximum'] = $this->auditMaximum;
        return empty($o) ? new class(){} : $o;
    }
}

class SectionsTimetableResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null,
        /** @var string|null */
        public ?string $term=null,
        /** @var array<SectionTimetableNoteResponse>|null */
        public ?array $notes=null,
        /** @var array<SectionTimetableResponse>|null */
        public ?array $monday=null,
        /** @var array<SectionTimetableResponse>|null */
        public ?array $tuesday=null,
        /** @var array<SectionTimetableResponse>|null */
        public ?array $wednesday=null,
        /** @var array<SectionTimetableResponse>|null */
        public ?array $thursday=null,
        /** @var array<SectionTimetableResponse>|null */
        public ?array $friday=null,
        /** @var array<SectionTimetableResponse>|null */
        public ?array $saturday=null,
        /** @var array<SectionTimetableResponse>|null */
        public ?array $sunday=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
        if (isset($o['term'])) $this->term = $o['term'];
        if (isset($o['notes'])) $this->notes = JsonConverters::fromArray('SectionTimetableNoteResponse', $o['notes']);
        if (isset($o['monday'])) $this->monday = JsonConverters::fromArray('SectionTimetableResponse', $o['monday']);
        if (isset($o['tuesday'])) $this->tuesday = JsonConverters::fromArray('SectionTimetableResponse', $o['tuesday']);
        if (isset($o['wednesday'])) $this->wednesday = JsonConverters::fromArray('SectionTimetableResponse', $o['wednesday']);
        if (isset($o['thursday'])) $this->thursday = JsonConverters::fromArray('SectionTimetableResponse', $o['thursday']);
        if (isset($o['friday'])) $this->friday = JsonConverters::fromArray('SectionTimetableResponse', $o['friday']);
        if (isset($o['saturday'])) $this->saturday = JsonConverters::fromArray('SectionTimetableResponse', $o['saturday']);
        if (isset($o['sunday'])) $this->sunday = JsonConverters::fromArray('SectionTimetableResponse', $o['sunday']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
        if (isset($this->term)) $o['term'] = $this->term;
        if (isset($this->notes)) $o['notes'] = JsonConverters::toArray('SectionTimetableNoteResponse', $this->notes);
        if (isset($this->monday)) $o['monday'] = JsonConverters::toArray('SectionTimetableResponse', $this->monday);
        if (isset($this->tuesday)) $o['tuesday'] = JsonConverters::toArray('SectionTimetableResponse', $this->tuesday);
        if (isset($this->wednesday)) $o['wednesday'] = JsonConverters::toArray('SectionTimetableResponse', $this->wednesday);
        if (isset($this->thursday)) $o['thursday'] = JsonConverters::toArray('SectionTimetableResponse', $this->thursday);
        if (isset($this->friday)) $o['friday'] = JsonConverters::toArray('SectionTimetableResponse', $this->friday);
        if (isset($this->saturday)) $o['saturday'] = JsonConverters::toArray('SectionTimetableResponse', $this->saturday);
        if (isset($this->sunday)) $o['sunday'] = JsonConverters::toArray('SectionTimetableResponse', $this->sunday);
        return empty($o) ? new class(){} : $o;
    }
}

class SectionsTimetableRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $reporting_term=null
    ) {
    }

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

PHP SectionsTimetableRequest 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.

POST /Sections/Timetable/{reporting_term} HTTP/1.1 
Host: data.regent-college.edu 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"reporting_term":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"term":"String","notes":[{"heading":"String","body":"String"}],"monday":[{"time":"String","sortTime":0,"course":"String","courseSlug":"String","desc":"String","instructors":[{"instructorName":"String","instructorSlug":"String"}],"registrationInfo":"String","room":"String","creditMinimum":0,"creditMaximum":0,"auditMinimum":0,"auditMaximum":0}],"tuesday":[{"time":"String","sortTime":0,"course":"String","courseSlug":"String","desc":"String","instructors":[{"instructorName":"String","instructorSlug":"String"}],"registrationInfo":"String","room":"String","creditMinimum":0,"creditMaximum":0,"auditMinimum":0,"auditMaximum":0}],"wednesday":[{"time":"String","sortTime":0,"course":"String","courseSlug":"String","desc":"String","instructors":[{"instructorName":"String","instructorSlug":"String"}],"registrationInfo":"String","room":"String","creditMinimum":0,"creditMaximum":0,"auditMinimum":0,"auditMaximum":0}],"thursday":[{"time":"String","sortTime":0,"course":"String","courseSlug":"String","desc":"String","instructors":[{"instructorName":"String","instructorSlug":"String"}],"registrationInfo":"String","room":"String","creditMinimum":0,"creditMaximum":0,"auditMinimum":0,"auditMaximum":0}],"friday":[{"time":"String","sortTime":0,"course":"String","courseSlug":"String","desc":"String","instructors":[{"instructorName":"String","instructorSlug":"String"}],"registrationInfo":"String","room":"String","creditMinimum":0,"creditMaximum":0,"auditMinimum":0,"auditMaximum":0}],"saturday":[{"time":"String","sortTime":0,"course":"String","courseSlug":"String","desc":"String","instructors":[{"instructorName":"String","instructorSlug":"String"}],"registrationInfo":"String","room":"String","creditMinimum":0,"creditMaximum":0,"auditMinimum":0,"auditMaximum":0}],"sunday":[{"time":"String","sortTime":0,"course":"String","courseSlug":"String","desc":"String","instructors":[{"instructorName":"String","instructorSlug":"String"}],"registrationInfo":"String","room":"String","creditMinimum":0,"creditMaximum":0,"auditMinimum":0,"auditMaximum":0}]}