Required role: | REGISUserRole |
POST | /TermStatements/{uuid}/{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 TermStatementRegistrationResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $course_name=null,
/** @var string|null */
public ?string $title=null,
/** @var string|null */
public ?string $section_code=null,
/** @var float */
public float $amount=0.0,
/** @var bool|null */
public ?bool $is_audit=null,
/** @var string|null */
public ?string $meeting_days=null,
/** @var string|null */
public ?string $times=null,
/** @var string|null */
public ?string $room=null,
/** @var string|null */
public ?string $instructor=null,
/** @var string|null */
public ?string $status=null,
/** @var float */
public float $cost=0.0,
/** @var DateTime|null */
public ?DateTime $start_date=null,
/** @var DateTime|null */
public ?DateTime $end_date=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['course_name'])) $this->course_name = $o['course_name'];
if (isset($o['title'])) $this->title = $o['title'];
if (isset($o['section_code'])) $this->section_code = $o['section_code'];
if (isset($o['amount'])) $this->amount = $o['amount'];
if (isset($o['is_audit'])) $this->is_audit = $o['is_audit'];
if (isset($o['meeting_days'])) $this->meeting_days = $o['meeting_days'];
if (isset($o['times'])) $this->times = $o['times'];
if (isset($o['room'])) $this->room = $o['room'];
if (isset($o['instructor'])) $this->instructor = $o['instructor'];
if (isset($o['status'])) $this->status = $o['status'];
if (isset($o['cost'])) $this->cost = $o['cost'];
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']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->course_name)) $o['course_name'] = $this->course_name;
if (isset($this->title)) $o['title'] = $this->title;
if (isset($this->section_code)) $o['section_code'] = $this->section_code;
if (isset($this->amount)) $o['amount'] = $this->amount;
if (isset($this->is_audit)) $o['is_audit'] = $this->is_audit;
if (isset($this->meeting_days)) $o['meeting_days'] = $this->meeting_days;
if (isset($this->times)) $o['times'] = $this->times;
if (isset($this->room)) $o['room'] = $this->room;
if (isset($this->instructor)) $o['instructor'] = $this->instructor;
if (isset($this->status)) $o['status'] = $this->status;
if (isset($this->cost)) $o['cost'] = $this->cost;
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);
return empty($o) ? new class(){} : $o;
}
}
class TermStatementChargesResponse implements JsonSerializable
{
public function __construct(
/** @var DateTime */
public DateTime $date=new DateTime(),
/** @var string|null */
public ?string $code=null,
/** @var string|null */
public ?string $description=null,
/** @var bool|null */
public ?bool $is_financial_aid=null,
/** @var float */
public float $charge=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['date'])) $this->date = JsonConverters::from('DateTime', $o['date']);
if (isset($o['code'])) $this->code = $o['code'];
if (isset($o['description'])) $this->description = $o['description'];
if (isset($o['is_financial_aid'])) $this->is_financial_aid = $o['is_financial_aid'];
if (isset($o['charge'])) $this->charge = $o['charge'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->date)) $o['date'] = JsonConverters::to('DateTime', $this->date);
if (isset($this->code)) $o['code'] = $this->code;
if (isset($this->description)) $o['description'] = $this->description;
if (isset($this->is_financial_aid)) $o['is_financial_aid'] = $this->is_financial_aid;
if (isset($this->charge)) $o['charge'] = $this->charge;
return empty($o) ? new class(){} : $o;
}
}
class TermStatementResponse 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 string|null */
public ?string $name=null,
/** @var string|null */
public ?string $addr1=null,
/** @var string|null */
public ?string $addr2=null,
/** @var string|null */
public ?string $city=null,
/** @var string|null */
public ?string $state=null,
/** @var string|null */
public ?string $country=null,
/** @var string|null */
public ?string $code=null,
/** @var string|null */
public ?string $reporting_term=null,
/** @var DateTime */
public DateTime $reporting_term_start_date=new DateTime(),
/** @var DateTime */
public DateTime $reporting_term_end_date=new DateTime(),
/** @var string|null */
public ?string $academic_program=null,
/** @var float */
public float $total_term_payments=0.0,
/** @var float */
public float $total_term_charges=0.0,
/** @var float */
public float $total_term_taxes=0.0,
/** @var array<TermStatementRegistrationResponse>|null */
public ?array $registrations=null,
/** @var array<TermStatementChargesResponse>|null */
public ?array $charges=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['name'])) $this->name = $o['name'];
if (isset($o['addr1'])) $this->addr1 = $o['addr1'];
if (isset($o['addr2'])) $this->addr2 = $o['addr2'];
if (isset($o['city'])) $this->city = $o['city'];
if (isset($o['state'])) $this->state = $o['state'];
if (isset($o['country'])) $this->country = $o['country'];
if (isset($o['code'])) $this->code = $o['code'];
if (isset($o['reporting_term'])) $this->reporting_term = $o['reporting_term'];
if (isset($o['reporting_term_start_date'])) $this->reporting_term_start_date = JsonConverters::from('DateTime', $o['reporting_term_start_date']);
if (isset($o['reporting_term_end_date'])) $this->reporting_term_end_date = JsonConverters::from('DateTime', $o['reporting_term_end_date']);
if (isset($o['academic_program'])) $this->academic_program = $o['academic_program'];
if (isset($o['total_term_payments'])) $this->total_term_payments = $o['total_term_payments'];
if (isset($o['total_term_charges'])) $this->total_term_charges = $o['total_term_charges'];
if (isset($o['total_term_taxes'])) $this->total_term_taxes = $o['total_term_taxes'];
if (isset($o['registrations'])) $this->registrations = JsonConverters::fromArray('TermStatementRegistrationResponse', $o['registrations']);
if (isset($o['charges'])) $this->charges = JsonConverters::fromArray('TermStatementChargesResponse', $o['charges']);
}
/** @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->name)) $o['name'] = $this->name;
if (isset($this->addr1)) $o['addr1'] = $this->addr1;
if (isset($this->addr2)) $o['addr2'] = $this->addr2;
if (isset($this->city)) $o['city'] = $this->city;
if (isset($this->state)) $o['state'] = $this->state;
if (isset($this->country)) $o['country'] = $this->country;
if (isset($this->code)) $o['code'] = $this->code;
if (isset($this->reporting_term)) $o['reporting_term'] = $this->reporting_term;
if (isset($this->reporting_term_start_date)) $o['reporting_term_start_date'] = JsonConverters::to('DateTime', $this->reporting_term_start_date);
if (isset($this->reporting_term_end_date)) $o['reporting_term_end_date'] = JsonConverters::to('DateTime', $this->reporting_term_end_date);
if (isset($this->academic_program)) $o['academic_program'] = $this->academic_program;
if (isset($this->total_term_payments)) $o['total_term_payments'] = $this->total_term_payments;
if (isset($this->total_term_charges)) $o['total_term_charges'] = $this->total_term_charges;
if (isset($this->total_term_taxes)) $o['total_term_taxes'] = $this->total_term_taxes;
if (isset($this->registrations)) $o['registrations'] = JsonConverters::toArray('TermStatementRegistrationResponse', $this->registrations);
if (isset($this->charges)) $o['charges'] = JsonConverters::toArray('TermStatementChargesResponse', $this->charges);
return empty($o) ? new class(){} : $o;
}
}
class TermStatementRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $uuid=null,
/** @var string|null */
public ?string $reporting_term=null,
/** @var string|null */
public ?string $authorizing_uuid=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['uuid'])) $this->uuid = $o['uuid'];
if (isset($o['reporting_term'])) $this->reporting_term = $o['reporting_term'];
if (isset($o['authorizing_uuid'])) $this->authorizing_uuid = $o['authorizing_uuid'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->uuid)) $o['uuid'] = $this->uuid;
if (isset($this->reporting_term)) $o['reporting_term'] = $this->reporting_term;
if (isset($this->authorizing_uuid)) $o['authorizing_uuid'] = $this->authorizing_uuid;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /TermStatements/{uuid}/{reporting_term} HTTP/1.1
Host: data.regent-college.edu
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<TermStatementRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/regis.ClassLibrary.Requests">
<authorizing_uuid>String</authorizing_uuid>
<reporting_term>String</reporting_term>
<uuid>String</uuid>
</TermStatementRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <TermStatementResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/regis.ClassLibrary.Responses"> <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types"> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:Message>String</d2p1:Message> <d2p1:StackTrace>String</d2p1:StackTrace> <d2p1:Errors> <d2p1:ResponseError> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:FieldName>String</d2p1:FieldName> <d2p1:Message>String</d2p1:Message> <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:KeyValueOfstringstring> <d5p1:Key>String</d5p1:Key> <d5p1:Value>String</d5p1:Value> </d5p1:KeyValueOfstringstring> </d2p1:Meta> </d2p1:ResponseError> </d2p1:Errors> <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringstring> <d3p1:Key>String</d3p1:Key> <d3p1:Value>String</d3p1:Value> </d3p1:KeyValueOfstringstring> </d2p1:Meta> </ResponseStatus> <academic_program>String</academic_program> <addr1>String</addr1> <addr2>String</addr2> <charges> <TermStatementChargesResponse> <charge>0</charge> <code>String</code> <date>0001-01-01T00:00:00</date> <description>String</description> <is_financial_aid>false</is_financial_aid> </TermStatementChargesResponse> </charges> <city>String</city> <code>String</code> <country>String</country> <name>String</name> <regent_id>0</regent_id> <registrations> <TermStatementRegistrationResponse> <amount>0</amount> <cost>0</cost> <course_name>String</course_name> <end_date>0001-01-01T00:00:00</end_date> <instructor>String</instructor> <is_audit>false</is_audit> <meeting_days>String</meeting_days> <room>String</room> <section_code>String</section_code> <start_date>0001-01-01T00:00:00</start_date> <status>String</status> <times>String</times> <title>String</title> </TermStatementRegistrationResponse> </registrations> <reporting_term>String</reporting_term> <reporting_term_end_date>0001-01-01T00:00:00</reporting_term_end_date> <reporting_term_start_date>0001-01-01T00:00:00</reporting_term_start_date> <state>String</state> <total_term_charges>0</total_term_charges> <total_term_payments>0</total_term_payments> <total_term_taxes>0</total_term_taxes> <uuid>String</uuid> </TermStatementResponse>