regis

<back to all web services

AddressSyncRequest

Requires Authentication
Required role:REGISUserRole
The following routes are available for this service:
POST/admissions/{uuid}/address/sync
<?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 AddressResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null,
        /** @var string|null */
        public ?string $addr1=null,
        /** @var string|null */
        public ?string $addr2=null,
        /** @var string|null */
        public ?string $country=null,
        /** @var string|null */
        public ?string $country_code=null,
        /** @var string|null */
        public ?string $state=null,
        /** @var string|null */
        public ?string $city=null,
        /** @var string|null */
        public ?string $code=null,
        /** @var DateTime|null */
        public ?DateTime $start_date=null,
        /** @var DateTime|null */
        public ?DateTime $end_date=null,
        /** @var string|null */
        public ?string $added_by=null,
        /** @var DateTime|null */
        public ?DateTime $added_date=null,
        /** @var string|null */
        public ?string $changed_by=null,
        /** @var DateTime|null */
        public ?DateTime $changed_date=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
        if (isset($o['addr1'])) $this->addr1 = $o['addr1'];
        if (isset($o['addr2'])) $this->addr2 = $o['addr2'];
        if (isset($o['country'])) $this->country = $o['country'];
        if (isset($o['country_code'])) $this->country_code = $o['country_code'];
        if (isset($o['state'])) $this->state = $o['state'];
        if (isset($o['city'])) $this->city = $o['city'];
        if (isset($o['code'])) $this->code = $o['code'];
        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['added_by'])) $this->added_by = $o['added_by'];
        if (isset($o['added_date'])) $this->added_date = JsonConverters::from('DateTime', $o['added_date']);
        if (isset($o['changed_by'])) $this->changed_by = $o['changed_by'];
        if (isset($o['changed_date'])) $this->changed_date = JsonConverters::from('DateTime', $o['changed_date']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
        if (isset($this->addr1)) $o['addr1'] = $this->addr1;
        if (isset($this->addr2)) $o['addr2'] = $this->addr2;
        if (isset($this->country)) $o['country'] = $this->country;
        if (isset($this->country_code)) $o['country_code'] = $this->country_code;
        if (isset($this->state)) $o['state'] = $this->state;
        if (isset($this->city)) $o['city'] = $this->city;
        if (isset($this->code)) $o['code'] = $this->code;
        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->added_by)) $o['added_by'] = $this->added_by;
        if (isset($this->added_date)) $o['added_date'] = JsonConverters::to('DateTime', $this->added_date);
        if (isset($this->changed_by)) $o['changed_by'] = $this->changed_by;
        if (isset($this->changed_date)) $o['changed_date'] = JsonConverters::to('DateTime', $this->changed_date);
        return empty($o) ? new class(){} : $o;
    }
}

class PhoneEmailResponse implements JsonSerializable
{
    public function __construct(
        /** @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 $email=null,
        /** @var DateTime|null */
        public ?DateTime $start_date=null,
        /** @var DateTime|null */
        public ?DateTime $end_date=null,
        /** @var string|null */
        public ?string $added_by=null,
        /** @var DateTime|null */
        public ?DateTime $added_date=null,
        /** @var string|null */
        public ?string $changed_by=null,
        /** @var DateTime|null */
        public ?DateTime $changed_date=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        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['email'])) $this->email = $o['email'];
        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['added_by'])) $this->added_by = $o['added_by'];
        if (isset($o['added_date'])) $this->added_date = JsonConverters::from('DateTime', $o['added_date']);
        if (isset($o['changed_by'])) $this->changed_by = $o['changed_by'];
        if (isset($o['changed_date'])) $this->changed_date = JsonConverters::from('DateTime', $o['changed_date']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        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->email)) $o['email'] = $this->email;
        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->added_by)) $o['added_by'] = $this->added_by;
        if (isset($this->added_date)) $o['added_date'] = JsonConverters::to('DateTime', $this->added_date);
        if (isset($this->changed_by)) $o['changed_by'] = $this->changed_by;
        if (isset($this->changed_date)) $o['changed_date'] = JsonConverters::to('DateTime', $this->changed_date);
        return empty($o) ? new class(){} : $o;
    }
}

class AddressSyncResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null,
        /** @var string|null */
        public ?string $uuid=null,
        /** @var int */
        public int $regent_id=0,
        /** @var AddressResponse|null */
        public ?AddressResponse $sugar_address=null,
        /** @var PhoneEmailResponse|null */
        public ?PhoneEmailResponse $sugar_phone_email=null,
        /** @var AddressResponse|null */
        public ?AddressResponse $regis_address=null,
        /** @var PhoneEmailResponse|null */
        public ?PhoneEmailResponse $regis_phone_email=null,
        /** @var AddressResponse|null */
        public ?AddressResponse $re_address=null,
        /** @var PhoneEmailResponse|null */
        public ?PhoneEmailResponse $re_phone_email=null,
        /** @var bool|null */
        public ?bool $exists_in_sugar=null,
        /** @var bool|null */
        public ?bool $exists_in_re=null,
        /** @var bool|null */
        public ?bool $are_equal=null,
        /** @var bool|null */
        public ?bool $addr_are_equal=null,
        /** @var bool|null */
        public ?bool $city_are_equal=null,
        /** @var bool|null */
        public ?bool $state_are_equal=null,
        /** @var bool|null */
        public ?bool $country_are_equal=null,
        /** @var bool|null */
        public ?bool $code_are_equal=null,
        /** @var bool|null */
        public ?bool $phone_home_are_equal=null,
        /** @var bool|null */
        public ?bool $phone_cell_are_equal=null,
        /** @var bool|null */
        public ?bool $phone_bus_are_equal=null,
        /** @var bool|null */
        public ?bool $email_are_equal=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
        if (isset($o['uuid'])) $this->uuid = $o['uuid'];
        if (isset($o['regent_id'])) $this->regent_id = $o['regent_id'];
        if (isset($o['sugar_address'])) $this->sugar_address = JsonConverters::from('AddressResponse', $o['sugar_address']);
        if (isset($o['sugar_phone_email'])) $this->sugar_phone_email = JsonConverters::from('PhoneEmailResponse', $o['sugar_phone_email']);
        if (isset($o['regis_address'])) $this->regis_address = JsonConverters::from('AddressResponse', $o['regis_address']);
        if (isset($o['regis_phone_email'])) $this->regis_phone_email = JsonConverters::from('PhoneEmailResponse', $o['regis_phone_email']);
        if (isset($o['re_address'])) $this->re_address = JsonConverters::from('AddressResponse', $o['re_address']);
        if (isset($o['re_phone_email'])) $this->re_phone_email = JsonConverters::from('PhoneEmailResponse', $o['re_phone_email']);
        if (isset($o['exists_in_sugar'])) $this->exists_in_sugar = $o['exists_in_sugar'];
        if (isset($o['exists_in_re'])) $this->exists_in_re = $o['exists_in_re'];
        if (isset($o['are_equal'])) $this->are_equal = $o['are_equal'];
        if (isset($o['addr_are_equal'])) $this->addr_are_equal = $o['addr_are_equal'];
        if (isset($o['city_are_equal'])) $this->city_are_equal = $o['city_are_equal'];
        if (isset($o['state_are_equal'])) $this->state_are_equal = $o['state_are_equal'];
        if (isset($o['country_are_equal'])) $this->country_are_equal = $o['country_are_equal'];
        if (isset($o['code_are_equal'])) $this->code_are_equal = $o['code_are_equal'];
        if (isset($o['phone_home_are_equal'])) $this->phone_home_are_equal = $o['phone_home_are_equal'];
        if (isset($o['phone_cell_are_equal'])) $this->phone_cell_are_equal = $o['phone_cell_are_equal'];
        if (isset($o['phone_bus_are_equal'])) $this->phone_bus_are_equal = $o['phone_bus_are_equal'];
        if (isset($o['email_are_equal'])) $this->email_are_equal = $o['email_are_equal'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
        if (isset($this->uuid)) $o['uuid'] = $this->uuid;
        if (isset($this->regent_id)) $o['regent_id'] = $this->regent_id;
        if (isset($this->sugar_address)) $o['sugar_address'] = JsonConverters::to('AddressResponse', $this->sugar_address);
        if (isset($this->sugar_phone_email)) $o['sugar_phone_email'] = JsonConverters::to('PhoneEmailResponse', $this->sugar_phone_email);
        if (isset($this->regis_address)) $o['regis_address'] = JsonConverters::to('AddressResponse', $this->regis_address);
        if (isset($this->regis_phone_email)) $o['regis_phone_email'] = JsonConverters::to('PhoneEmailResponse', $this->regis_phone_email);
        if (isset($this->re_address)) $o['re_address'] = JsonConverters::to('AddressResponse', $this->re_address);
        if (isset($this->re_phone_email)) $o['re_phone_email'] = JsonConverters::to('PhoneEmailResponse', $this->re_phone_email);
        if (isset($this->exists_in_sugar)) $o['exists_in_sugar'] = $this->exists_in_sugar;
        if (isset($this->exists_in_re)) $o['exists_in_re'] = $this->exists_in_re;
        if (isset($this->are_equal)) $o['are_equal'] = $this->are_equal;
        if (isset($this->addr_are_equal)) $o['addr_are_equal'] = $this->addr_are_equal;
        if (isset($this->city_are_equal)) $o['city_are_equal'] = $this->city_are_equal;
        if (isset($this->state_are_equal)) $o['state_are_equal'] = $this->state_are_equal;
        if (isset($this->country_are_equal)) $o['country_are_equal'] = $this->country_are_equal;
        if (isset($this->code_are_equal)) $o['code_are_equal'] = $this->code_are_equal;
        if (isset($this->phone_home_are_equal)) $o['phone_home_are_equal'] = $this->phone_home_are_equal;
        if (isset($this->phone_cell_are_equal)) $o['phone_cell_are_equal'] = $this->phone_cell_are_equal;
        if (isset($this->phone_bus_are_equal)) $o['phone_bus_are_equal'] = $this->phone_bus_are_equal;
        if (isset($this->email_are_equal)) $o['email_are_equal'] = $this->email_are_equal;
        return empty($o) ? new class(){} : $o;
    }
}

class AddressSyncRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $uuid=null
    ) {
    }

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

PHP AddressSyncRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /admissions/{uuid}/address/sync HTTP/1.1 
Host: data.regent-college.edu 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"uuid":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"uuid":"String","regent_id":0,"sugar_address":{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"addr1":"String","addr2":"String","country":"String","country_code":"String","state":"String","city":"String","code":"String","start_date":"0001-01-01T00:00:00.0000000","end_date":"0001-01-01T00:00:00.0000000","added_by":"String","added_date":"0001-01-01T00:00:00.0000000","changed_by":"String","changed_date":"0001-01-01T00:00:00.0000000"},"sugar_phone_email":{"phone_home":"String","phone_cell":"String","phone_bus":"String","email":"String","start_date":"0001-01-01T00:00:00.0000000","end_date":"0001-01-01T00:00:00.0000000","added_by":"String","added_date":"0001-01-01T00:00:00.0000000","changed_by":"String","changed_date":"0001-01-01T00:00:00.0000000"},"regis_address":{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"addr1":"String","addr2":"String","country":"String","country_code":"String","state":"String","city":"String","code":"String","start_date":"0001-01-01T00:00:00.0000000","end_date":"0001-01-01T00:00:00.0000000","added_by":"String","added_date":"0001-01-01T00:00:00.0000000","changed_by":"String","changed_date":"0001-01-01T00:00:00.0000000"},"regis_phone_email":{"phone_home":"String","phone_cell":"String","phone_bus":"String","email":"String","start_date":"0001-01-01T00:00:00.0000000","end_date":"0001-01-01T00:00:00.0000000","added_by":"String","added_date":"0001-01-01T00:00:00.0000000","changed_by":"String","changed_date":"0001-01-01T00:00:00.0000000"},"re_address":{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"addr1":"String","addr2":"String","country":"String","country_code":"String","state":"String","city":"String","code":"String","start_date":"0001-01-01T00:00:00.0000000","end_date":"0001-01-01T00:00:00.0000000","added_by":"String","added_date":"0001-01-01T00:00:00.0000000","changed_by":"String","changed_date":"0001-01-01T00:00:00.0000000"},"re_phone_email":{"phone_home":"String","phone_cell":"String","phone_bus":"String","email":"String","start_date":"0001-01-01T00:00:00.0000000","end_date":"0001-01-01T00:00:00.0000000","added_by":"String","added_date":"0001-01-01T00:00:00.0000000","changed_by":"String","changed_date":"0001-01-01T00:00:00.0000000"},"exists_in_sugar":false,"exists_in_re":false,"are_equal":false,"addr_are_equal":false,"city_are_equal":false,"state_are_equal":false,"country_are_equal":false,"code_are_equal":false,"phone_home_are_equal":false,"phone_cell_are_equal":false,"phone_bus_are_equal":false,"email_are_equal":false}