regis

<back to all web services

SyncAddressRequest

Requires Authentication
Required permission:SyncBioAndAddresses
The following routes are available for this service:
POST/Sync/Address
<?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 SyncBioAndAddressResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null,
        /** @var bool|null */
        public ?bool $successfull=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
        if (isset($o['successfull'])) $this->successfull = $o['successfull'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
        if (isset($this->successfull)) $o['successfull'] = $this->successfull;
        return empty($o) ? new class(){} : $o;
    }
}

class SyncAddressRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $regent_id=0,
        /** @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_bus=null,
        /** @var string|null */
        public ?string $phone_cell=null,
        /** @var string|null */
        public ?string $queued_by_username=null,
        /** @var bool|null */
        public ?bool $queued_by_CRM=null,
        /** @var bool|null */
        public ?bool $queued_by_RE=null,
        /** @var bool|null */
        public ?bool $queued_by_Sugar=null,
        /** @var bool|null */
        public ?bool $queued_by_REGIS=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['regent_id'])) $this->regent_id = $o['regent_id'];
        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_bus'])) $this->phone_bus = $o['phone_bus'];
        if (isset($o['phone_cell'])) $this->phone_cell = $o['phone_cell'];
        if (isset($o['queued_by_username'])) $this->queued_by_username = $o['queued_by_username'];
        if (isset($o['queued_by_CRM'])) $this->queued_by_CRM = $o['queued_by_CRM'];
        if (isset($o['queued_by_RE'])) $this->queued_by_RE = $o['queued_by_RE'];
        if (isset($o['queued_by_Sugar'])) $this->queued_by_Sugar = $o['queued_by_Sugar'];
        if (isset($o['queued_by_REGIS'])) $this->queued_by_REGIS = $o['queued_by_REGIS'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->regent_id)) $o['regent_id'] = $this->regent_id;
        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_bus)) $o['phone_bus'] = $this->phone_bus;
        if (isset($this->phone_cell)) $o['phone_cell'] = $this->phone_cell;
        if (isset($this->queued_by_username)) $o['queued_by_username'] = $this->queued_by_username;
        if (isset($this->queued_by_CRM)) $o['queued_by_CRM'] = $this->queued_by_CRM;
        if (isset($this->queued_by_RE)) $o['queued_by_RE'] = $this->queued_by_RE;
        if (isset($this->queued_by_Sugar)) $o['queued_by_Sugar'] = $this->queued_by_Sugar;
        if (isset($this->queued_by_REGIS)) $o['queued_by_REGIS'] = $this->queued_by_REGIS;
        return empty($o) ? new class(){} : $o;
    }
}

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

{
	regent_id: 0,
	addr1: String,
	addr2: String,
	city: String,
	state: String,
	country: String,
	code: String,
	email: String,
	phone_home: String,
	phone_bus: String,
	phone_cell: String,
	queued_by_username: String,
	queued_by_CRM: False,
	queued_by_RE: False,
	queued_by_Sugar: False,
	queued_by_REGIS: False
}
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
		}
	},
	successfull: False
}