regis

<back to all web services

RegentDegreesRequest

Requires Authentication
Required role:REGISUserRole
The following routes are available for this service:
POST/Academic/{uuid}/RegentDegrees
<?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 RegentDegreeResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $id=0,
        /** @var string|null */
        public ?string $program_code=null,
        /** @var string|null */
        public ?string $program_name=null,
        /** @var string|null */
        public ?string $concentration_code=null,
        /** @var string|null */
        public ?string $concentration_name=null,
        /** @var DateTime|null */
        public ?DateTime $graduation_month=null,
        /** @var DateTime|null */
        public ?DateTime $start_date=null,
        /** @var DateTime|null */
        public ?DateTime $end_date=null,
        /** @var float|null */
        public ?float $gpa=null,
        /** @var string|null */
        public ?string $academic_level=null,
        /** @var DateTime|null */
        public ?DateTime $commencement_date=null,
        /** @var DateTime|null */
        public ?DateTime $added_date=null,
        /** @var string|null */
        public ?string $added_by=null,
        /** @var DateTime|null */
        public ?DateTime $changed_date=null,
        /** @var string|null */
        public ?string $changed_by=null,
        /** @var DateTime */
        public DateTime $timestamp=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['program_code'])) $this->program_code = $o['program_code'];
        if (isset($o['program_name'])) $this->program_name = $o['program_name'];
        if (isset($o['concentration_code'])) $this->concentration_code = $o['concentration_code'];
        if (isset($o['concentration_name'])) $this->concentration_name = $o['concentration_name'];
        if (isset($o['graduation_month'])) $this->graduation_month = JsonConverters::from('DateTime', $o['graduation_month']);
        if (isset($o['start_date'])) $this->start_date = JsonConverters::from('DateTime', $o['start_date']);
        if (isset($o['end_date'])) $this->end_date = JsonConverters::from('DateTime', $o['end_date']);
        if (isset($o['gpa'])) $this->gpa = $o['gpa'];
        if (isset($o['academic_level'])) $this->academic_level = $o['academic_level'];
        if (isset($o['commencement_date'])) $this->commencement_date = JsonConverters::from('DateTime', $o['commencement_date']);
        if (isset($o['added_date'])) $this->added_date = JsonConverters::from('DateTime', $o['added_date']);
        if (isset($o['added_by'])) $this->added_by = $o['added_by'];
        if (isset($o['changed_date'])) $this->changed_date = JsonConverters::from('DateTime', $o['changed_date']);
        if (isset($o['changed_by'])) $this->changed_by = $o['changed_by'];
        if (isset($o['timestamp'])) $this->timestamp = JsonConverters::from('DateTime', $o['timestamp']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->program_code)) $o['program_code'] = $this->program_code;
        if (isset($this->program_name)) $o['program_name'] = $this->program_name;
        if (isset($this->concentration_code)) $o['concentration_code'] = $this->concentration_code;
        if (isset($this->concentration_name)) $o['concentration_name'] = $this->concentration_name;
        if (isset($this->graduation_month)) $o['graduation_month'] = JsonConverters::to('DateTime', $this->graduation_month);
        if (isset($this->start_date)) $o['start_date'] = JsonConverters::to('DateTime', $this->start_date);
        if (isset($this->end_date)) $o['end_date'] = JsonConverters::to('DateTime', $this->end_date);
        if (isset($this->gpa)) $o['gpa'] = $this->gpa;
        if (isset($this->academic_level)) $o['academic_level'] = $this->academic_level;
        if (isset($this->commencement_date)) $o['commencement_date'] = JsonConverters::to('DateTime', $this->commencement_date);
        if (isset($this->added_date)) $o['added_date'] = JsonConverters::to('DateTime', $this->added_date);
        if (isset($this->added_by)) $o['added_by'] = $this->added_by;
        if (isset($this->changed_date)) $o['changed_date'] = JsonConverters::to('DateTime', $this->changed_date);
        if (isset($this->changed_by)) $o['changed_by'] = $this->changed_by;
        if (isset($this->timestamp)) $o['timestamp'] = JsonConverters::to('DateTime', $this->timestamp);
        return empty($o) ? new class(){} : $o;
    }
}

class ProgramResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null,
        /** @var int */
        public int $id=0,
        /** @var string|null */
        public ?string $program_code=null,
        /** @var string|null */
        public ?string $program_pretty_code=null,
        /** @var string|null */
        public ?string $program_long_name=null,
        /** @var string|null */
        public ?string $available_concentrations=null,
        /** @var bool|null */
        public ?bool $is_active=null,
        /** @var DateTime */
        public DateTime $timestamp=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['program_code'])) $this->program_code = $o['program_code'];
        if (isset($o['program_pretty_code'])) $this->program_pretty_code = $o['program_pretty_code'];
        if (isset($o['program_long_name'])) $this->program_long_name = $o['program_long_name'];
        if (isset($o['available_concentrations'])) $this->available_concentrations = $o['available_concentrations'];
        if (isset($o['is_active'])) $this->is_active = $o['is_active'];
        if (isset($o['timestamp'])) $this->timestamp = JsonConverters::from('DateTime', $o['timestamp']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->program_code)) $o['program_code'] = $this->program_code;
        if (isset($this->program_pretty_code)) $o['program_pretty_code'] = $this->program_pretty_code;
        if (isset($this->program_long_name)) $o['program_long_name'] = $this->program_long_name;
        if (isset($this->available_concentrations)) $o['available_concentrations'] = $this->available_concentrations;
        if (isset($this->is_active)) $o['is_active'] = $this->is_active;
        if (isset($this->timestamp)) $o['timestamp'] = JsonConverters::to('DateTime', $this->timestamp);
        return empty($o) ? new class(){} : $o;
    }
}

class ConcentrationResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null,
        /** @var int */
        public int $id=0,
        /** @var string|null */
        public ?string $concentration_code=null,
        /** @var string|null */
        public ?string $concentration_name=null,
        /** @var bool|null */
        public ?bool $is_active=null
    ) {
    }

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

class CatalogResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null,
        /** @var int */
        public int $id=0,
        /** @var string|null */
        public ?string $catalog_code=null
    ) {
    }

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

class RegentDegreesResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null,
        /** @var int */
        public int $regent_id=0,
        /** @var string|null */
        public ?string $uuid=null,
        /** @var array<RegentDegreeResponse>|null */
        public ?array $regent_degrees=null,
        /** @var array<ProgramResponse>|null */
        public ?array $valid_programs=null,
        /** @var array<ConcentrationResponse>|null */
        public ?array $valid_concentrations=null,
        /** @var array<CatalogResponse>|null */
        public ?array $valid_catalogs=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
        if (isset($o['regent_id'])) $this->regent_id = $o['regent_id'];
        if (isset($o['uuid'])) $this->uuid = $o['uuid'];
        if (isset($o['regent_degrees'])) $this->regent_degrees = JsonConverters::fromArray('RegentDegreeResponse', $o['regent_degrees']);
        if (isset($o['valid_programs'])) $this->valid_programs = JsonConverters::fromArray('ProgramResponse', $o['valid_programs']);
        if (isset($o['valid_concentrations'])) $this->valid_concentrations = JsonConverters::fromArray('ConcentrationResponse', $o['valid_concentrations']);
        if (isset($o['valid_catalogs'])) $this->valid_catalogs = JsonConverters::fromArray('CatalogResponse', $o['valid_catalogs']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
        if (isset($this->regent_id)) $o['regent_id'] = $this->regent_id;
        if (isset($this->uuid)) $o['uuid'] = $this->uuid;
        if (isset($this->regent_degrees)) $o['regent_degrees'] = JsonConverters::toArray('RegentDegreeResponse', $this->regent_degrees);
        if (isset($this->valid_programs)) $o['valid_programs'] = JsonConverters::toArray('ProgramResponse', $this->valid_programs);
        if (isset($this->valid_concentrations)) $o['valid_concentrations'] = JsonConverters::toArray('ConcentrationResponse', $this->valid_concentrations);
        if (isset($this->valid_catalogs)) $o['valid_catalogs'] = JsonConverters::toArray('CatalogResponse', $this->valid_catalogs);
        return empty($o) ? new class(){} : $o;
    }
}

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

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

PHP RegentDegreesRequest 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 /Academic/{uuid}/RegentDegrees HTTP/1.1 
Host: data.regent-college.edu 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"uuid":"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"}},"regent_id":0,"uuid":"String","regent_degrees":[{"id":0,"program_code":"String","program_name":"String","concentration_code":"String","concentration_name":"String","graduation_month":"0001-01-01T00:00:00.0000000","start_date":"0001-01-01T00:00:00.0000000","end_date":"0001-01-01T00:00:00.0000000","gpa":0,"academic_level":"String","commencement_date":"0001-01-01T00:00:00.0000000","added_date":"0001-01-01T00:00:00.0000000","added_by":"String","changed_date":"0001-01-01T00:00:00.0000000","changed_by":"String","timestamp":"0001-01-01T00:00:00.0000000"}],"valid_programs":[{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"id":0,"program_code":"String","program_pretty_code":"String","program_long_name":"String","available_concentrations":"String","is_active":false,"timestamp":"0001-01-01T00:00:00.0000000"}],"valid_concentrations":[{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"id":0,"concentration_code":"String","concentration_name":"String","is_active":false}],"valid_catalogs":[{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"id":0,"catalog_code":"String"}]}