regis

<back to all web services

DirectoryPersonRequest

Requires Authentication
Required role:REGISUserRole
The following routes are available for this service:
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 .jsv suffix or ?format=jsv

HTTP + JSV

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: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	directory_uuid: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	},
	directory_uuid: String,
	waiver: String,
	bday: 0001-01-01,
	spouse_bday: 0001-01-01,
	spouse_name: String,
	wedding_date: 0001-01-01,
	kids: String,
	home_country: String,
	quote: String,
	bio: String,
	interests: String,
	category: String,
	imageBase64: String,
	preferred_name: String,
	last_name: String,
	addr1: String,
	addr2: String,
	city: String,
	state: String,
	country: String,
	code: String,
	email: String,
	phone_home: String,
	phone_cell: String,
	program: String,
	field_of_work: String,
	church: String,
	is_student: False,
	is_staff: False,
	is_faculty: False
}