regis

<back to all web services

OrganizationCreateRequest

Requires Authentication
Required permission:CreateOrganization
The following routes are available for this service:
POST/organization/create
<?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 OrganizationResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null,
        /** @var int */
        public int $organization_id=0,
        /** @var string|null */
        public ?string $organization_name=null,
        /** @var string|null */
        public ?string $email=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 $phone_cell=null,
        /** @var string|null */
        public ?string $phone_bus=null,
        /** @var string|null */
        public ?string $phone_home=null,
        /** @var bool|null */
        public ?bool $is_institution=null,
        /** @var bool|null */
        public ?bool $is_vendor=null,
        /** @var bool|null */
        public ?bool $is_re=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
        if (isset($o['organization_id'])) $this->organization_id = $o['organization_id'];
        if (isset($o['organization_name'])) $this->organization_name = $o['organization_name'];
        if (isset($o['email'])) $this->email = $o['email'];
        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['phone_cell'])) $this->phone_cell = $o['phone_cell'];
        if (isset($o['phone_bus'])) $this->phone_bus = $o['phone_bus'];
        if (isset($o['phone_home'])) $this->phone_home = $o['phone_home'];
        if (isset($o['is_institution'])) $this->is_institution = $o['is_institution'];
        if (isset($o['is_vendor'])) $this->is_vendor = $o['is_vendor'];
        if (isset($o['is_re'])) $this->is_re = $o['is_re'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
        if (isset($this->organization_id)) $o['organization_id'] = $this->organization_id;
        if (isset($this->organization_name)) $o['organization_name'] = $this->organization_name;
        if (isset($this->email)) $o['email'] = $this->email;
        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->phone_cell)) $o['phone_cell'] = $this->phone_cell;
        if (isset($this->phone_bus)) $o['phone_bus'] = $this->phone_bus;
        if (isset($this->phone_home)) $o['phone_home'] = $this->phone_home;
        if (isset($this->is_institution)) $o['is_institution'] = $this->is_institution;
        if (isset($this->is_vendor)) $o['is_vendor'] = $this->is_vendor;
        if (isset($this->is_re)) $o['is_re'] = $this->is_re;
        return empty($o) ? new class(){} : $o;
    }
}

class OrganizationCreateRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $organization_name=null,
        /** @var string|null */
        public ?string $email=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 $phone_home=null,
        /** @var string|null */
        public ?string $phone_cell=null,
        /** @var string|null */
        public ?string $phone_bus=null,
        /** @var string|null */
        public ?string $authorizing_uuid=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['organization_name'])) $this->organization_name = $o['organization_name'];
        if (isset($o['email'])) $this->email = $o['email'];
        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['phone_home'])) $this->phone_home = $o['phone_home'];
        if (isset($o['phone_cell'])) $this->phone_cell = $o['phone_cell'];
        if (isset($o['phone_bus'])) $this->phone_bus = $o['phone_bus'];
        if (isset($o['authorizing_uuid'])) $this->authorizing_uuid = $o['authorizing_uuid'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->organization_name)) $o['organization_name'] = $this->organization_name;
        if (isset($this->email)) $o['email'] = $this->email;
        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->phone_home)) $o['phone_home'] = $this->phone_home;
        if (isset($this->phone_cell)) $o['phone_cell'] = $this->phone_cell;
        if (isset($this->phone_bus)) $o['phone_bus'] = $this->phone_bus;
        if (isset($this->authorizing_uuid)) $o['authorizing_uuid'] = $this->authorizing_uuid;
        return empty($o) ? new class(){} : $o;
    }
}

PHP OrganizationCreateRequest 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 /organization/create HTTP/1.1 
Host: data.regent-college.edu 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	organization_name: String,
	email: String,
	addr1: String,
	addr2: String,
	city: String,
	state: String,
	country: String,
	code: String,
	phone_home: String,
	phone_cell: String,
	phone_bus: String,
	authorizing_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
		}
	},
	organization_id: 0,
	organization_name: String,
	email: String,
	addr1: String,
	addr2: String,
	city: String,
	state: String,
	country: String,
	code: String,
	phone_cell: String,
	phone_bus: String,
	phone_home: String,
	is_institution: False,
	is_vendor: False,
	is_re: False
}