Trendsic Platform Service

<back to all web services

BranchApptCreateRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
POST,OPTIONS/v1/queue/appointments
<?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 BranchApptWriteResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var int */
        public int $CalendarEventId=0,
        /** @var string */
        public string $CheckInId='',
        /** @var DateTime|null */
        public ?DateTime $StartLocal=null,
        /** @var DateTime|null */
        public ?DateTime $EndLocal=null,
        /** @var int */
        public int $ContactId=0,
        /** @var bool|null */
        public ?bool $ContactExisted=null,
        /** @var bool|null */
        public ?bool $Notified=null,
        /** @var int|null */
        public ?int $Open=null,
        /** @var int|null */
        public ?int $Capacity=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['CalendarEventId'])) $this->CalendarEventId = $o['CalendarEventId'];
        if (isset($o['CheckInId'])) $this->CheckInId = $o['CheckInId'];
        if (isset($o['StartLocal'])) $this->StartLocal = JsonConverters::from('DateTime', $o['StartLocal']);
        if (isset($o['EndLocal'])) $this->EndLocal = JsonConverters::from('DateTime', $o['EndLocal']);
        if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
        if (isset($o['ContactExisted'])) $this->ContactExisted = $o['ContactExisted'];
        if (isset($o['Notified'])) $this->Notified = $o['Notified'];
        if (isset($o['Open'])) $this->Open = $o['Open'];
        if (isset($o['Capacity'])) $this->Capacity = $o['Capacity'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->CalendarEventId)) $o['CalendarEventId'] = $this->CalendarEventId;
        if (isset($this->CheckInId)) $o['CheckInId'] = $this->CheckInId;
        if (isset($this->StartLocal)) $o['StartLocal'] = JsonConverters::to('DateTime', $this->StartLocal);
        if (isset($this->EndLocal)) $o['EndLocal'] = JsonConverters::to('DateTime', $this->EndLocal);
        if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
        if (isset($this->ContactExisted)) $o['ContactExisted'] = $this->ContactExisted;
        if (isset($this->Notified)) $o['Notified'] = $this->Notified;
        if (isset($this->Open)) $o['Open'] = $this->Open;
        if (isset($this->Capacity)) $o['Capacity'] = $this->Capacity;
        return empty($o) ? new class(){} : $o;
    }
}

class BranchApptNewContact implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Name=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['Name'])) $this->Name = $o['Name'];
        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->Name)) $o['Name'] = $this->Name;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        return empty($o) ? new class(){} : $o;
    }
}

class BranchApptCreateRequest implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $LocationId='',
        /** @var string|null */
        public ?string $Date=null,
        /** @var string|null */
        public ?string $StartLocal=null,
        /** @var array<string>|null */
        public ?array $LineIds=null,
        /** @var int|null */
        public ?int $ContactId=null,
        /** @var BranchApptNewContact|null */
        public ?BranchApptNewContact $NewContact=null,
        /** @var string|null */
        public ?string $Via=null,
        /** @var bool|null */
        public ?bool $Notify=null,
        /** @var string|null */
        public ?string $Note=null,
        /** @var bool|null */
        public ?bool $Overbook=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['LocationId'])) $this->LocationId = $o['LocationId'];
        if (isset($o['Date'])) $this->Date = $o['Date'];
        if (isset($o['StartLocal'])) $this->StartLocal = $o['StartLocal'];
        if (isset($o['LineIds'])) $this->LineIds = JsonConverters::fromArray('Guid', $o['LineIds']);
        if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
        if (isset($o['NewContact'])) $this->NewContact = JsonConverters::from('BranchApptNewContact', $o['NewContact']);
        if (isset($o['Via'])) $this->Via = $o['Via'];
        if (isset($o['Notify'])) $this->Notify = $o['Notify'];
        if (isset($o['Note'])) $this->Note = $o['Note'];
        if (isset($o['Overbook'])) $this->Overbook = $o['Overbook'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->LocationId)) $o['LocationId'] = $this->LocationId;
        if (isset($this->Date)) $o['Date'] = $this->Date;
        if (isset($this->StartLocal)) $o['StartLocal'] = $this->StartLocal;
        if (isset($this->LineIds)) $o['LineIds'] = JsonConverters::toArray('Guid', $this->LineIds);
        if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
        if (isset($this->NewContact)) $o['NewContact'] = JsonConverters::to('BranchApptNewContact', $this->NewContact);
        if (isset($this->Via)) $o['Via'] = $this->Via;
        if (isset($this->Notify)) $o['Notify'] = $this->Notify;
        if (isset($this->Note)) $o['Note'] = $this->Note;
        if (isset($this->Overbook)) $o['Overbook'] = $this->Overbook;
        return empty($o) ? new class(){} : $o;
    }
}

PHP BranchApptCreateRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /v1/queue/appointments HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"LocationId":"00000000000000000000000000000000","Date":"String","StartLocal":"String","LineIds":["00000000000000000000000000000000"],"ContactId":0,"NewContact":{"Name":"String","Phone":"String","Email":"String"},"Via":"String","Notify":false,"Note":"String","Overbook":false}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"CalendarEventId":0,"CheckInId":"00000000000000000000000000000000","StartLocal":"0001-01-01T00:00:00.0000000","EndLocal":"0001-01-01T00:00:00.0000000","ContactId":0,"ContactExisted":false,"Notified":false,"Open":0,"Capacity":0}