Required role: | REGISUserRole |
POST | /Sections/Admin/Update/{uuid} |
---|
<?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 SectionUpdateRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $uuid=null,
/** @var int|null */
public ?int $course_id=null,
/** @var string|null */
public ?string $course_name=null,
/** @var float|null */
public ?float $min_credits=null,
/** @var float|null */
public ?float $max_credits=null,
/** @var float|null */
public ?float $credit_increments=null,
/** @var float|null */
public ?float $min_audits=null,
/** @var float|null */
public ?float $max_audits=null,
/** @var float|null */
public ?float $audit_increments=null,
/** @var string|null */
public ?string $section_code=null,
/** @var string|null */
public ?string $title=null,
/** @var string|null */
public ?string $pretty_title=null,
/** @var string|null */
public ?string $override_course_description=null,
/** @var string|null */
public ?string $current_status=null,
/** @var string|null */
public ?string $location=null,
/** @var string|null */
public ?string $room=null,
/** @var bool|null */
public ?bool $is_audio=null,
/** @var bool|null */
public ?bool $is_oncampus=null,
/** @var string|null */
public ?string $distance_ed_materials=null,
/** @var DateTime|null */
public ?DateTime $start_date=null,
/** @var DateTime|null */
public ?DateTime $end_date=null,
/** @var string|null */
public ?string $meeting_days=null,
/** @var string|null */
public ?string $start_times=null,
/** @var string|null */
public ?string $end_times=null,
/** @var DateTime|null */
public ?DateTime $first_meeting_date=null,
/** @var DateTime|null */
public ?DateTime $last_meeting_date=null,
/** @var bool|null */
public ?bool $is_pass_fail=null,
/** @var bool|null */
public ?bool $is_waitlist=null,
/** @var bool|null */
public ?bool $has_special_requirements=null,
/** @var string|null */
public ?string $special_requirements=null,
/** @var bool|null */
public ?bool $is_unlisted=null,
/** @var int|null */
public ?int $capacity=null,
/** @var float|null */
public ?float $flat_fee_amount=null,
/** @var float|null */
public ?float $additional_fee_amount=null,
/** @var DateTime|null */
public ?DateTime $override_registration_start_date=null,
/** @var DateTime|null */
public ?DateTime $override_registration_end_date=null,
/** @var DateTime|null */
public ?DateTime $override_add_start_date=null,
/** @var DateTime|null */
public ?DateTime $override_add_end_date=null,
/** @var DateTime|null */
public ?DateTime $override_drop_start_date=null,
/** @var DateTime|null */
public ?DateTime $override_drop_end_date=null,
/** @var DateTime|null */
public ?DateTime $override_grading_end_date=null,
/** @var string|null */
public ?string $term=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['course_id'])) $this->course_id = $o['course_id'];
if (isset($o['course_name'])) $this->course_name = $o['course_name'];
if (isset($o['min_credits'])) $this->min_credits = $o['min_credits'];
if (isset($o['max_credits'])) $this->max_credits = $o['max_credits'];
if (isset($o['credit_increments'])) $this->credit_increments = $o['credit_increments'];
if (isset($o['min_audits'])) $this->min_audits = $o['min_audits'];
if (isset($o['max_audits'])) $this->max_audits = $o['max_audits'];
if (isset($o['audit_increments'])) $this->audit_increments = $o['audit_increments'];
if (isset($o['section_code'])) $this->section_code = $o['section_code'];
if (isset($o['title'])) $this->title = $o['title'];
if (isset($o['pretty_title'])) $this->pretty_title = $o['pretty_title'];
if (isset($o['override_course_description'])) $this->override_course_description = $o['override_course_description'];
if (isset($o['current_status'])) $this->current_status = $o['current_status'];
if (isset($o['location'])) $this->location = $o['location'];
if (isset($o['room'])) $this->room = $o['room'];
if (isset($o['is_audio'])) $this->is_audio = $o['is_audio'];
if (isset($o['is_oncampus'])) $this->is_oncampus = $o['is_oncampus'];
if (isset($o['distance_ed_materials'])) $this->distance_ed_materials = $o['distance_ed_materials'];
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['meeting_days'])) $this->meeting_days = $o['meeting_days'];
if (isset($o['start_times'])) $this->start_times = $o['start_times'];
if (isset($o['end_times'])) $this->end_times = $o['end_times'];
if (isset($o['first_meeting_date'])) $this->first_meeting_date = JsonConverters::from('DateTime', $o['first_meeting_date']);
if (isset($o['last_meeting_date'])) $this->last_meeting_date = JsonConverters::from('DateTime', $o['last_meeting_date']);
if (isset($o['is_pass_fail'])) $this->is_pass_fail = $o['is_pass_fail'];
if (isset($o['is_waitlist'])) $this->is_waitlist = $o['is_waitlist'];
if (isset($o['has_special_requirements'])) $this->has_special_requirements = $o['has_special_requirements'];
if (isset($o['special_requirements'])) $this->special_requirements = $o['special_requirements'];
if (isset($o['is_unlisted'])) $this->is_unlisted = $o['is_unlisted'];
if (isset($o['capacity'])) $this->capacity = $o['capacity'];
if (isset($o['flat_fee_amount'])) $this->flat_fee_amount = $o['flat_fee_amount'];
if (isset($o['additional_fee_amount'])) $this->additional_fee_amount = $o['additional_fee_amount'];
if (isset($o['override_registration_start_date'])) $this->override_registration_start_date = JsonConverters::from('DateTime', $o['override_registration_start_date']);
if (isset($o['override_registration_end_date'])) $this->override_registration_end_date = JsonConverters::from('DateTime', $o['override_registration_end_date']);
if (isset($o['override_add_start_date'])) $this->override_add_start_date = JsonConverters::from('DateTime', $o['override_add_start_date']);
if (isset($o['override_add_end_date'])) $this->override_add_end_date = JsonConverters::from('DateTime', $o['override_add_end_date']);
if (isset($o['override_drop_start_date'])) $this->override_drop_start_date = JsonConverters::from('DateTime', $o['override_drop_start_date']);
if (isset($o['override_drop_end_date'])) $this->override_drop_end_date = JsonConverters::from('DateTime', $o['override_drop_end_date']);
if (isset($o['override_grading_end_date'])) $this->override_grading_end_date = JsonConverters::from('DateTime', $o['override_grading_end_date']);
if (isset($o['term'])) $this->term = $o['term'];
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->course_id)) $o['course_id'] = $this->course_id;
if (isset($this->course_name)) $o['course_name'] = $this->course_name;
if (isset($this->min_credits)) $o['min_credits'] = $this->min_credits;
if (isset($this->max_credits)) $o['max_credits'] = $this->max_credits;
if (isset($this->credit_increments)) $o['credit_increments'] = $this->credit_increments;
if (isset($this->min_audits)) $o['min_audits'] = $this->min_audits;
if (isset($this->max_audits)) $o['max_audits'] = $this->max_audits;
if (isset($this->audit_increments)) $o['audit_increments'] = $this->audit_increments;
if (isset($this->section_code)) $o['section_code'] = $this->section_code;
if (isset($this->title)) $o['title'] = $this->title;
if (isset($this->pretty_title)) $o['pretty_title'] = $this->pretty_title;
if (isset($this->override_course_description)) $o['override_course_description'] = $this->override_course_description;
if (isset($this->current_status)) $o['current_status'] = $this->current_status;
if (isset($this->location)) $o['location'] = $this->location;
if (isset($this->room)) $o['room'] = $this->room;
if (isset($this->is_audio)) $o['is_audio'] = $this->is_audio;
if (isset($this->is_oncampus)) $o['is_oncampus'] = $this->is_oncampus;
if (isset($this->distance_ed_materials)) $o['distance_ed_materials'] = $this->distance_ed_materials;
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->meeting_days)) $o['meeting_days'] = $this->meeting_days;
if (isset($this->start_times)) $o['start_times'] = $this->start_times;
if (isset($this->end_times)) $o['end_times'] = $this->end_times;
if (isset($this->first_meeting_date)) $o['first_meeting_date'] = JsonConverters::to('DateTime', $this->first_meeting_date);
if (isset($this->last_meeting_date)) $o['last_meeting_date'] = JsonConverters::to('DateTime', $this->last_meeting_date);
if (isset($this->is_pass_fail)) $o['is_pass_fail'] = $this->is_pass_fail;
if (isset($this->is_waitlist)) $o['is_waitlist'] = $this->is_waitlist;
if (isset($this->has_special_requirements)) $o['has_special_requirements'] = $this->has_special_requirements;
if (isset($this->special_requirements)) $o['special_requirements'] = $this->special_requirements;
if (isset($this->is_unlisted)) $o['is_unlisted'] = $this->is_unlisted;
if (isset($this->capacity)) $o['capacity'] = $this->capacity;
if (isset($this->flat_fee_amount)) $o['flat_fee_amount'] = $this->flat_fee_amount;
if (isset($this->additional_fee_amount)) $o['additional_fee_amount'] = $this->additional_fee_amount;
if (isset($this->override_registration_start_date)) $o['override_registration_start_date'] = JsonConverters::to('DateTime', $this->override_registration_start_date);
if (isset($this->override_registration_end_date)) $o['override_registration_end_date'] = JsonConverters::to('DateTime', $this->override_registration_end_date);
if (isset($this->override_add_start_date)) $o['override_add_start_date'] = JsonConverters::to('DateTime', $this->override_add_start_date);
if (isset($this->override_add_end_date)) $o['override_add_end_date'] = JsonConverters::to('DateTime', $this->override_add_end_date);
if (isset($this->override_drop_start_date)) $o['override_drop_start_date'] = JsonConverters::to('DateTime', $this->override_drop_start_date);
if (isset($this->override_drop_end_date)) $o['override_drop_end_date'] = JsonConverters::to('DateTime', $this->override_drop_end_date);
if (isset($this->override_grading_end_date)) $o['override_grading_end_date'] = JsonConverters::to('DateTime', $this->override_grading_end_date);
if (isset($this->term)) $o['term'] = $this->term;
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 /Sections/Admin/Update/{uuid} HTTP/1.1
Host: data.regent-college.edu
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<SectionUpdateRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/regis.ClassLibrary.Requests">
<additional_fee_amount>0</additional_fee_amount>
<audit_increments>0</audit_increments>
<authorizing_uuid>String</authorizing_uuid>
<capacity>0</capacity>
<course_id>0</course_id>
<course_name>String</course_name>
<credit_increments>0</credit_increments>
<current_status>String</current_status>
<distance_ed_materials>String</distance_ed_materials>
<end_date>0001-01-01T00:00:00</end_date>
<end_times>String</end_times>
<first_meeting_date>0001-01-01T00:00:00</first_meeting_date>
<flat_fee_amount>0</flat_fee_amount>
<has_special_requirements>false</has_special_requirements>
<is_audio>false</is_audio>
<is_oncampus>false</is_oncampus>
<is_pass_fail>false</is_pass_fail>
<is_unlisted>false</is_unlisted>
<is_waitlist>false</is_waitlist>
<last_meeting_date>0001-01-01T00:00:00</last_meeting_date>
<location>String</location>
<max_audits>0</max_audits>
<max_credits>0</max_credits>
<meeting_days>String</meeting_days>
<min_audits>0</min_audits>
<min_credits>0</min_credits>
<override_add_end_date>0001-01-01T00:00:00</override_add_end_date>
<override_add_start_date>0001-01-01T00:00:00</override_add_start_date>
<override_course_description>String</override_course_description>
<override_drop_end_date>0001-01-01T00:00:00</override_drop_end_date>
<override_drop_start_date>0001-01-01T00:00:00</override_drop_start_date>
<override_grading_end_date>0001-01-01T00:00:00</override_grading_end_date>
<override_registration_end_date>0001-01-01T00:00:00</override_registration_end_date>
<override_registration_start_date>0001-01-01T00:00:00</override_registration_start_date>
<pretty_title>String</pretty_title>
<reporting_term>String</reporting_term>
<room>String</room>
<section_code>String</section_code>
<special_requirements>String</special_requirements>
<start_date>0001-01-01T00:00:00</start_date>
<start_times>String</start_times>
<term>String</term>
<title>String</title>
<uuid>String</uuid>
</SectionUpdateRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ResponseStatus xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types"> <ErrorCode>String</ErrorCode> <Message>String</Message> <StackTrace>String</StackTrace> <Errors> <ResponseError> <ErrorCode>String</ErrorCode> <FieldName>String</FieldName> <Message>String</Message> <Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d4p1:KeyValueOfstringstring> <d4p1:Key>String</d4p1:Key> <d4p1:Value>String</d4p1:Value> </d4p1:KeyValueOfstringstring> </Meta> </ResponseError> </Errors> <Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:KeyValueOfstringstring> <d2p1:Key>String</d2p1:Key> <d2p1:Value>String</d2p1:Value> </d2p1:KeyValueOfstringstring> </Meta> </ResponseStatus>