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 .xml suffix or ?format=xml

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<AddressSyncRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/regis.ClassLibrary.Requests">
  <uuid>String</uuid>
</AddressSyncRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<AddressSyncResponse 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>
  <addr_are_equal>false</addr_are_equal>
  <are_equal>false</are_equal>
  <city_are_equal>false</city_are_equal>
  <code_are_equal>false</code_are_equal>
  <country_are_equal>false</country_are_equal>
  <email_are_equal>false</email_are_equal>
  <exists_in_re>false</exists_in_re>
  <exists_in_sugar>false</exists_in_sugar>
  <phone_bus_are_equal>false</phone_bus_are_equal>
  <phone_cell_are_equal>false</phone_cell_are_equal>
  <phone_home_are_equal>false</phone_home_are_equal>
  <re_address>
    <ResponseStatus xmlns:d3p1="http://schemas.servicestack.net/types">
      <d3p1:ErrorCode>String</d3p1:ErrorCode>
      <d3p1:Message>String</d3p1:Message>
      <d3p1:StackTrace>String</d3p1:StackTrace>
      <d3p1:Errors>
        <d3p1:ResponseError>
          <d3p1:ErrorCode>String</d3p1:ErrorCode>
          <d3p1:FieldName>String</d3p1:FieldName>
          <d3p1:Message>String</d3p1:Message>
          <d3p1:Meta xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:KeyValueOfstringstring>
              <d6p1:Key>String</d6p1:Key>
              <d6p1:Value>String</d6p1:Value>
            </d6p1:KeyValueOfstringstring>
          </d3p1:Meta>
        </d3p1:ResponseError>
      </d3p1:Errors>
      <d3p1:Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringstring>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value>String</d4p1:Value>
        </d4p1:KeyValueOfstringstring>
      </d3p1:Meta>
    </ResponseStatus>
    <added_by>String</added_by>
    <added_date>0001-01-01T00:00:00</added_date>
    <addr1>String</addr1>
    <addr2>String</addr2>
    <changed_by>String</changed_by>
    <changed_date>0001-01-01T00:00:00</changed_date>
    <city>String</city>
    <code>String</code>
    <country>String</country>
    <country_code>String</country_code>
    <end_date>0001-01-01T00:00:00</end_date>
    <start_date>0001-01-01T00:00:00</start_date>
    <state>String</state>
  </re_address>
  <re_phone_email>
    <added_by>String</added_by>
    <added_date>0001-01-01T00:00:00</added_date>
    <changed_by>String</changed_by>
    <changed_date>0001-01-01T00:00:00</changed_date>
    <email>String</email>
    <end_date>0001-01-01T00:00:00</end_date>
    <phone_bus>String</phone_bus>
    <phone_cell>String</phone_cell>
    <phone_home>String</phone_home>
    <start_date>0001-01-01T00:00:00</start_date>
  </re_phone_email>
  <regent_id>0</regent_id>
  <regis_address>
    <ResponseStatus xmlns:d3p1="http://schemas.servicestack.net/types">
      <d3p1:ErrorCode>String</d3p1:ErrorCode>
      <d3p1:Message>String</d3p1:Message>
      <d3p1:StackTrace>String</d3p1:StackTrace>
      <d3p1:Errors>
        <d3p1:ResponseError>
          <d3p1:ErrorCode>String</d3p1:ErrorCode>
          <d3p1:FieldName>String</d3p1:FieldName>
          <d3p1:Message>String</d3p1:Message>
          <d3p1:Meta xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:KeyValueOfstringstring>
              <d6p1:Key>String</d6p1:Key>
              <d6p1:Value>String</d6p1:Value>
            </d6p1:KeyValueOfstringstring>
          </d3p1:Meta>
        </d3p1:ResponseError>
      </d3p1:Errors>
      <d3p1:Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringstring>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value>String</d4p1:Value>
        </d4p1:KeyValueOfstringstring>
      </d3p1:Meta>
    </ResponseStatus>
    <added_by>String</added_by>
    <added_date>0001-01-01T00:00:00</added_date>
    <addr1>String</addr1>
    <addr2>String</addr2>
    <changed_by>String</changed_by>
    <changed_date>0001-01-01T00:00:00</changed_date>
    <city>String</city>
    <code>String</code>
    <country>String</country>
    <country_code>String</country_code>
    <end_date>0001-01-01T00:00:00</end_date>
    <start_date>0001-01-01T00:00:00</start_date>
    <state>String</state>
  </regis_address>
  <regis_phone_email>
    <added_by>String</added_by>
    <added_date>0001-01-01T00:00:00</added_date>
    <changed_by>String</changed_by>
    <changed_date>0001-01-01T00:00:00</changed_date>
    <email>String</email>
    <end_date>0001-01-01T00:00:00</end_date>
    <phone_bus>String</phone_bus>
    <phone_cell>String</phone_cell>
    <phone_home>String</phone_home>
    <start_date>0001-01-01T00:00:00</start_date>
  </regis_phone_email>
  <state_are_equal>false</state_are_equal>
  <sugar_address>
    <ResponseStatus xmlns:d3p1="http://schemas.servicestack.net/types">
      <d3p1:ErrorCode>String</d3p1:ErrorCode>
      <d3p1:Message>String</d3p1:Message>
      <d3p1:StackTrace>String</d3p1:StackTrace>
      <d3p1:Errors>
        <d3p1:ResponseError>
          <d3p1:ErrorCode>String</d3p1:ErrorCode>
          <d3p1:FieldName>String</d3p1:FieldName>
          <d3p1:Message>String</d3p1:Message>
          <d3p1:Meta xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:KeyValueOfstringstring>
              <d6p1:Key>String</d6p1:Key>
              <d6p1:Value>String</d6p1:Value>
            </d6p1:KeyValueOfstringstring>
          </d3p1:Meta>
        </d3p1:ResponseError>
      </d3p1:Errors>
      <d3p1:Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringstring>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value>String</d4p1:Value>
        </d4p1:KeyValueOfstringstring>
      </d3p1:Meta>
    </ResponseStatus>
    <added_by>String</added_by>
    <added_date>0001-01-01T00:00:00</added_date>
    <addr1>String</addr1>
    <addr2>String</addr2>
    <changed_by>String</changed_by>
    <changed_date>0001-01-01T00:00:00</changed_date>
    <city>String</city>
    <code>String</code>
    <country>String</country>
    <country_code>String</country_code>
    <end_date>0001-01-01T00:00:00</end_date>
    <start_date>0001-01-01T00:00:00</start_date>
    <state>String</state>
  </sugar_address>
  <sugar_phone_email>
    <added_by>String</added_by>
    <added_date>0001-01-01T00:00:00</added_date>
    <changed_by>String</changed_by>
    <changed_date>0001-01-01T00:00:00</changed_date>
    <email>String</email>
    <end_date>0001-01-01T00:00:00</end_date>
    <phone_bus>String</phone_bus>
    <phone_cell>String</phone_cell>
    <phone_home>String</phone_home>
    <start_date>0001-01-01T00:00:00</start_date>
  </sugar_phone_email>
  <uuid>String</uuid>
</AddressSyncResponse>