Trendsic Platform Service

<back to all web services

BranchTransferContactRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/branch/transfer/contact
<?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 Branch implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $BranchId='',
        /** @var string */
        public string $TenantId='',
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Address1=null,
        /** @var string|null */
        public ?string $Address2=null,
        /** @var string|null */
        public ?string $City=null,
        /** @var string|null */
        public ?string $State=null,
        /** @var string|null */
        public ?string $Zip=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var float|null */
        public ?float $Latitude=null,
        /** @var float|null */
        public ?float $Longitude=null,
        /** @var string|null */
        public ?string $TimeZoneId=null,
        /** @var bool|null */
        public ?bool $IsDefault=null,
        /** @var bool|null */
        public ?bool $IsActive=null,
        /** @var string|null */
        public ?string $CreatedBy=null,
        /** @var DateTime|null */
        public ?DateTime $CreatedAt=null,
        /** @var DateTime|null */
        public ?DateTime $UpdatedAt=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
        if (isset($o['TenantId'])) $this->TenantId = $o['TenantId'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['Address1'])) $this->Address1 = $o['Address1'];
        if (isset($o['Address2'])) $this->Address2 = $o['Address2'];
        if (isset($o['City'])) $this->City = $o['City'];
        if (isset($o['State'])) $this->State = $o['State'];
        if (isset($o['Zip'])) $this->Zip = $o['Zip'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['Latitude'])) $this->Latitude = $o['Latitude'];
        if (isset($o['Longitude'])) $this->Longitude = $o['Longitude'];
        if (isset($o['TimeZoneId'])) $this->TimeZoneId = $o['TimeZoneId'];
        if (isset($o['IsDefault'])) $this->IsDefault = $o['IsDefault'];
        if (isset($o['IsActive'])) $this->IsActive = $o['IsActive'];
        if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
        if (isset($o['CreatedAt'])) $this->CreatedAt = JsonConverters::from('DateTime', $o['CreatedAt']);
        if (isset($o['UpdatedAt'])) $this->UpdatedAt = JsonConverters::from('DateTime', $o['UpdatedAt']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
        if (isset($this->TenantId)) $o['TenantId'] = $this->TenantId;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->Address1)) $o['Address1'] = $this->Address1;
        if (isset($this->Address2)) $o['Address2'] = $this->Address2;
        if (isset($this->City)) $o['City'] = $this->City;
        if (isset($this->State)) $o['State'] = $this->State;
        if (isset($this->Zip)) $o['Zip'] = $this->Zip;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->Latitude)) $o['Latitude'] = $this->Latitude;
        if (isset($this->Longitude)) $o['Longitude'] = $this->Longitude;
        if (isset($this->TimeZoneId)) $o['TimeZoneId'] = $this->TimeZoneId;
        if (isset($this->IsDefault)) $o['IsDefault'] = $this->IsDefault;
        if (isset($this->IsActive)) $o['IsActive'] = $this->IsActive;
        if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
        if (isset($this->CreatedAt)) $o['CreatedAt'] = JsonConverters::to('DateTime', $this->CreatedAt);
        if (isset($this->UpdatedAt)) $o['UpdatedAt'] = JsonConverters::to('DateTime', $this->UpdatedAt);
        return empty($o) ? new class(){} : $o;
    }
}

class BranchResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<Branch>|null */
        public ?array $Branches=null
    ) {
    }

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

class BranchTransferContactRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ContactId=0,
        /** @var string */
        public string $BranchId=''
    ) {
    }

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

PHP BranchTransferContactRequest 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 /v1/branch/transfer/contact HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<BranchTransferContactRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <BranchId>00000000-0000-0000-0000-000000000000</BranchId>
  <ContactId>0</ContactId>
</BranchTransferContactRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<BranchResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Branches>
    <Branch>
      <Address1>String</Address1>
      <Address2>String</Address2>
      <BranchId>00000000-0000-0000-0000-000000000000</BranchId>
      <City>String</City>
      <Code>String</Code>
      <CreatedAt>0001-01-01T00:00:00</CreatedAt>
      <CreatedBy>String</CreatedBy>
      <IsActive>false</IsActive>
      <IsDefault>false</IsDefault>
      <Latitude>0</Latitude>
      <Longitude>0</Longitude>
      <Name>String</Name>
      <Phone>String</Phone>
      <State>String</State>
      <TenantId>00000000-0000-0000-0000-000000000000</TenantId>
      <TimeZoneId>String</TimeZoneId>
      <UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
      <Zip>String</Zip>
    </Branch>
  </Branches>
  <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>
</BranchResponse>