Trendsic Platform Service

<back to all web services

BranchApptContactsRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET,OPTIONS/v1/queue/appointments/contacts
<?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 BranchApptContact implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ContactId=0,
        /** @var string */
        public string $ContactGuid='',
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var string|null */
        public ?string $Email=null,
        /** @var int */
        public int $PastVisits=0,
        /** @var DateTime|null */
        public ?DateTime $LastVisitLocal=null,
        /** @var DateTime|null */
        public ?DateTime $NextLocal=null,
        /** @var bool|null */
        public ?bool $PhoneMatch=null,
        /** @var bool|null */
        public ?bool $EmailMatch=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
        if (isset($o['ContactGuid'])) $this->ContactGuid = $o['ContactGuid'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['PastVisits'])) $this->PastVisits = $o['PastVisits'];
        if (isset($o['LastVisitLocal'])) $this->LastVisitLocal = JsonConverters::from('DateTime', $o['LastVisitLocal']);
        if (isset($o['NextLocal'])) $this->NextLocal = JsonConverters::from('DateTime', $o['NextLocal']);
        if (isset($o['PhoneMatch'])) $this->PhoneMatch = $o['PhoneMatch'];
        if (isset($o['EmailMatch'])) $this->EmailMatch = $o['EmailMatch'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
        if (isset($this->ContactGuid)) $o['ContactGuid'] = $this->ContactGuid;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->PastVisits)) $o['PastVisits'] = $this->PastVisits;
        if (isset($this->LastVisitLocal)) $o['LastVisitLocal'] = JsonConverters::to('DateTime', $this->LastVisitLocal);
        if (isset($this->NextLocal)) $o['NextLocal'] = JsonConverters::to('DateTime', $this->NextLocal);
        if (isset($this->PhoneMatch)) $o['PhoneMatch'] = $this->PhoneMatch;
        if (isset($this->EmailMatch)) $o['EmailMatch'] = $this->EmailMatch;
        return empty($o) ? new class(){} : $o;
    }
}

class BranchApptContactsResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<BranchApptContact>|null */
        public ?array $Contacts=null,
        /** @var BranchApptContact|null */
        public ?BranchApptContact $Duplicate=null
    ) {
    }

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

class BranchApptContactsRequest implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $LocationId='',
        /** @var string|null */
        public ?string $Q=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var string|null */
        public ?string $Email=null
    ) {
    }

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

PHP BranchApptContactsRequest 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.

GET /v1/queue/appointments/contacts HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
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"}},"Contacts":[{"ContactId":0,"ContactGuid":"00000000000000000000000000000000","Name":"String","Phone":"String","Email":"String","PastVisits":0,"LastVisitLocal":"0001-01-01T00:00:00.0000000","NextLocal":"0001-01-01T00:00:00.0000000","PhoneMatch":false,"EmailMatch":false}],"Duplicate":{"ContactId":0,"ContactGuid":"00000000000000000000000000000000","Name":"String","Phone":"String","Email":"String","PastVisits":0,"LastVisitLocal":"0001-01-01T00:00:00.0000000","NextLocal":"0001-01-01T00:00:00.0000000","PhoneMatch":false,"EmailMatch":false}}