Required role: | REGISUserRole |
POST | /Directory/{directory_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 DirectoryPersonResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null,
/** @var string|null */
public ?string $directory_uuid=null,
/** @var string|null */
public ?string $waiver=null,
/** @var DateTime|null */
public ?DateTime $bday=null,
/** @var DateTime|null */
public ?DateTime $spouse_bday=null,
/** @var string|null */
public ?string $spouse_name=null,
/** @var DateTime|null */
public ?DateTime $wedding_date=null,
/** @var string|null */
public ?string $kids=null,
/** @var string|null */
public ?string $home_country=null,
/** @var string|null */
public ?string $quote=null,
/** @var string|null */
public ?string $bio=null,
/** @var string|null */
public ?string $interests=null,
/** @var string|null */
public ?string $category=null,
/** @var string|null */
public ?string $imageBase64=null,
/** @var string|null */
public ?string $preferred_name=null,
/** @var string|null */
public ?string $last_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 $email=null,
/** @var string|null */
public ?string $phone_home=null,
/** @var string|null */
public ?string $phone_cell=null,
/** @var string|null */
public ?string $program=null,
/** @var string|null */
public ?string $field_of_work=null,
/** @var string|null */
public ?string $church=null,
/** @var bool|null */
public ?bool $is_student=null,
/** @var bool|null */
public ?bool $is_staff=null,
/** @var bool|null */
public ?bool $is_faculty=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
if (isset($o['directory_uuid'])) $this->directory_uuid = $o['directory_uuid'];
if (isset($o['waiver'])) $this->waiver = $o['waiver'];
if (isset($o['bday'])) $this->bday = JsonConverters::from('DateTime', $o['bday']);
if (isset($o['spouse_bday'])) $this->spouse_bday = JsonConverters::from('DateTime', $o['spouse_bday']);
if (isset($o['spouse_name'])) $this->spouse_name = $o['spouse_name'];
if (isset($o['wedding_date'])) $this->wedding_date = JsonConverters::from('DateTime', $o['wedding_date']);
if (isset($o['kids'])) $this->kids = $o['kids'];
if (isset($o['home_country'])) $this->home_country = $o['home_country'];
if (isset($o['quote'])) $this->quote = $o['quote'];
if (isset($o['bio'])) $this->bio = $o['bio'];
if (isset($o['interests'])) $this->interests = $o['interests'];
if (isset($o['category'])) $this->category = $o['category'];
if (isset($o['imageBase64'])) $this->imageBase64 = $o['imageBase64'];
if (isset($o['preferred_name'])) $this->preferred_name = $o['preferred_name'];
if (isset($o['last_name'])) $this->last_name = $o['last_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['email'])) $this->email = $o['email'];
if (isset($o['phone_home'])) $this->phone_home = $o['phone_home'];
if (isset($o['phone_cell'])) $this->phone_cell = $o['phone_cell'];
if (isset($o['program'])) $this->program = $o['program'];
if (isset($o['field_of_work'])) $this->field_of_work = $o['field_of_work'];
if (isset($o['church'])) $this->church = $o['church'];
if (isset($o['is_student'])) $this->is_student = $o['is_student'];
if (isset($o['is_staff'])) $this->is_staff = $o['is_staff'];
if (isset($o['is_faculty'])) $this->is_faculty = $o['is_faculty'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
if (isset($this->directory_uuid)) $o['directory_uuid'] = $this->directory_uuid;
if (isset($this->waiver)) $o['waiver'] = $this->waiver;
if (isset($this->bday)) $o['bday'] = JsonConverters::to('DateTime', $this->bday);
if (isset($this->spouse_bday)) $o['spouse_bday'] = JsonConverters::to('DateTime', $this->spouse_bday);
if (isset($this->spouse_name)) $o['spouse_name'] = $this->spouse_name;
if (isset($this->wedding_date)) $o['wedding_date'] = JsonConverters::to('DateTime', $this->wedding_date);
if (isset($this->kids)) $o['kids'] = $this->kids;
if (isset($this->home_country)) $o['home_country'] = $this->home_country;
if (isset($this->quote)) $o['quote'] = $this->quote;
if (isset($this->bio)) $o['bio'] = $this->bio;
if (isset($this->interests)) $o['interests'] = $this->interests;
if (isset($this->category)) $o['category'] = $this->category;
if (isset($this->imageBase64)) $o['imageBase64'] = $this->imageBase64;
if (isset($this->preferred_name)) $o['preferred_name'] = $this->preferred_name;
if (isset($this->last_name)) $o['last_name'] = $this->last_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->email)) $o['email'] = $this->email;
if (isset($this->phone_home)) $o['phone_home'] = $this->phone_home;
if (isset($this->phone_cell)) $o['phone_cell'] = $this->phone_cell;
if (isset($this->program)) $o['program'] = $this->program;
if (isset($this->field_of_work)) $o['field_of_work'] = $this->field_of_work;
if (isset($this->church)) $o['church'] = $this->church;
if (isset($this->is_student)) $o['is_student'] = $this->is_student;
if (isset($this->is_staff)) $o['is_staff'] = $this->is_staff;
if (isset($this->is_faculty)) $o['is_faculty'] = $this->is_faculty;
return empty($o) ? new class(){} : $o;
}
}
class DirectoryPersonRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $directory_uuid=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['directory_uuid'])) $this->directory_uuid = $o['directory_uuid'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->directory_uuid)) $o['directory_uuid'] = $this->directory_uuid;
return empty($o) ? new class(){} : $o;
}
}
PHP DirectoryPersonRequest DTOs
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 /Directory/{directory_uuid} HTTP/1.1
Host: data.regent-college.edu
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<DirectoryPersonRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/regis.ClassLibrary.Requests">
<directory_uuid>String</directory_uuid>
</DirectoryPersonRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <DirectoryPersonResponse 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> <addr1>String</addr1> <addr2>String</addr2> <bday>0001-01-01T00:00:00</bday> <bio>String</bio> <category>String</category> <church>String</church> <city>String</city> <code>String</code> <country>String</country> <directory_uuid>String</directory_uuid> <email>String</email> <field_of_work>String</field_of_work> <home_country>String</home_country> <imageBase64>String</imageBase64> <interests>String</interests> <is_faculty>false</is_faculty> <is_staff>false</is_staff> <is_student>false</is_student> <kids>String</kids> <last_name>String</last_name> <phone_cell>String</phone_cell> <phone_home>String</phone_home> <preferred_name>String</preferred_name> <program>String</program> <quote>String</quote> <spouse_bday>0001-01-01T00:00:00</spouse_bday> <spouse_name>String</spouse_name> <state>String</state> <waiver>String</waiver> <wedding_date>0001-01-01T00:00:00</wedding_date> </DirectoryPersonResponse>