Trendsic Platform Service

<back to all web services

SchedulerConfigurationRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/Scheduler/Settings/{LocationId}/{AgentId}/{Mode}
<?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 SchedulerConfigurationRequest implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $LocationId='',
        /** @var int */
        public int $AgentId=0,
        /** @var string|null */
        public ?string $Mode=null
    ) {
    }

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

class ScheduleConfigTimeBlock implements JsonSerializable
{
    public function __construct(
        /** @var DateInterval|null */
        public ?DateInterval $StartTime=null,
        /** @var string|null */
        public ?string $DayStartFriendly=null,
        /** @var DateInterval|null */
        public ?DateInterval $EndTime=null,
        /** @var string|null */
        public ?string $DayEndFriendly=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['StartTime'])) $this->StartTime = JsonConverters::from('DateInterval', $o['StartTime']);
        if (isset($o['DayStartFriendly'])) $this->DayStartFriendly = $o['DayStartFriendly'];
        if (isset($o['EndTime'])) $this->EndTime = JsonConverters::from('DateInterval', $o['EndTime']);
        if (isset($o['DayEndFriendly'])) $this->DayEndFriendly = $o['DayEndFriendly'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->StartTime)) $o['StartTime'] = JsonConverters::to('DateInterval', $this->StartTime);
        if (isset($this->DayStartFriendly)) $o['DayStartFriendly'] = $this->DayStartFriendly;
        if (isset($this->EndTime)) $o['EndTime'] = JsonConverters::to('DateInterval', $this->EndTime);
        if (isset($this->DayEndFriendly)) $o['DayEndFriendly'] = $this->DayEndFriendly;
        return empty($o) ? new class(){} : $o;
    }
}

class ScheduleConfigDay implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $DayName=null,
        /** @var int|null */
        public ?int $DayNumber=null,
        /** @var bool|null */
        public ?bool $DayEnabled=null,
        /** @var array<ScheduleConfigTimeBlock>|null */
        public ?array $TimeBlocks=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['DayName'])) $this->DayName = $o['DayName'];
        if (isset($o['DayNumber'])) $this->DayNumber = $o['DayNumber'];
        if (isset($o['DayEnabled'])) $this->DayEnabled = $o['DayEnabled'];
        if (isset($o['TimeBlocks'])) $this->TimeBlocks = JsonConverters::fromArray('ScheduleConfigTimeBlock', $o['TimeBlocks']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->DayName)) $o['DayName'] = $this->DayName;
        if (isset($this->DayNumber)) $o['DayNumber'] = $this->DayNumber;
        if (isset($this->DayEnabled)) $o['DayEnabled'] = $this->DayEnabled;
        if (isset($this->TimeBlocks)) $o['TimeBlocks'] = JsonConverters::toArray('ScheduleConfigTimeBlock', $this->TimeBlocks);
        return empty($o) ? new class(){} : $o;
    }
}

class LineImage implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $ImageId=null,
        /** @var string|null */
        public ?string $FileName=null,
        /** @var string|null */
        public ?string $ImageTitle=null,
        /** @var DateTime */
        public DateTime $UploadDate=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ImageId'])) $this->ImageId = $o['ImageId'];
        if (isset($o['FileName'])) $this->FileName = $o['FileName'];
        if (isset($o['ImageTitle'])) $this->ImageTitle = $o['ImageTitle'];
        if (isset($o['UploadDate'])) $this->UploadDate = JsonConverters::from('DateTime', $o['UploadDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ImageId)) $o['ImageId'] = $this->ImageId;
        if (isset($this->FileName)) $o['FileName'] = $this->FileName;
        if (isset($this->ImageTitle)) $o['ImageTitle'] = $this->ImageTitle;
        if (isset($this->UploadDate)) $o['UploadDate'] = JsonConverters::to('DateTime', $this->UploadDate);
        return empty($o) ? new class(){} : $o;
    }
}

class Line implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Id='',
        /** @var string */
        public string $LocationId='',
        /** @var string|null */
        public ?string $LocationName=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var int */
        public int $ServiceDurationMinutes=0,
        /** @var int */
        public int $WaitTime=0,
        /** @var float */
        public float $Cost=0.0,
        /** @var int|null */
        public ?int $UpperThreshold=null,
        /** @var int|null */
        public ?int $LowerThreshold=null,
        /** @var bool|null */
        public ?bool $Active=null,
        /** @var DateTime|null */
        public ?DateTime $EntDate=null,
        /** @var DateTime|null */
        public ?DateTime $ModDate=null,
        /** @var bool|null */
        public ?bool $SendQuestionnaire=null,
        /** @var bool|null */
        public ?bool $RequireUpload=null,
        /** @var string|null */
        public ?string $UploadMessage=null,
        /** @var array<LineImage>|null */
        public ?array $LineImages=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['LocationId'])) $this->LocationId = $o['LocationId'];
        if (isset($o['LocationName'])) $this->LocationName = $o['LocationName'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ServiceDurationMinutes'])) $this->ServiceDurationMinutes = $o['ServiceDurationMinutes'];
        if (isset($o['WaitTime'])) $this->WaitTime = $o['WaitTime'];
        if (isset($o['Cost'])) $this->Cost = $o['Cost'];
        if (isset($o['UpperThreshold'])) $this->UpperThreshold = $o['UpperThreshold'];
        if (isset($o['LowerThreshold'])) $this->LowerThreshold = $o['LowerThreshold'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['EntDate'])) $this->EntDate = JsonConverters::from('DateTime', $o['EntDate']);
        if (isset($o['ModDate'])) $this->ModDate = JsonConverters::from('DateTime', $o['ModDate']);
        if (isset($o['SendQuestionnaire'])) $this->SendQuestionnaire = $o['SendQuestionnaire'];
        if (isset($o['RequireUpload'])) $this->RequireUpload = $o['RequireUpload'];
        if (isset($o['UploadMessage'])) $this->UploadMessage = $o['UploadMessage'];
        if (isset($o['LineImages'])) $this->LineImages = JsonConverters::fromArray('LineImage', $o['LineImages']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->LocationId)) $o['LocationId'] = $this->LocationId;
        if (isset($this->LocationName)) $o['LocationName'] = $this->LocationName;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ServiceDurationMinutes)) $o['ServiceDurationMinutes'] = $this->ServiceDurationMinutes;
        if (isset($this->WaitTime)) $o['WaitTime'] = $this->WaitTime;
        if (isset($this->Cost)) $o['Cost'] = $this->Cost;
        if (isset($this->UpperThreshold)) $o['UpperThreshold'] = $this->UpperThreshold;
        if (isset($this->LowerThreshold)) $o['LowerThreshold'] = $this->LowerThreshold;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->EntDate)) $o['EntDate'] = JsonConverters::to('DateTime', $this->EntDate);
        if (isset($this->ModDate)) $o['ModDate'] = JsonConverters::to('DateTime', $this->ModDate);
        if (isset($this->SendQuestionnaire)) $o['SendQuestionnaire'] = $this->SendQuestionnaire;
        if (isset($this->RequireUpload)) $o['RequireUpload'] = $this->RequireUpload;
        if (isset($this->UploadMessage)) $o['UploadMessage'] = $this->UploadMessage;
        if (isset($this->LineImages)) $o['LineImages'] = JsonConverters::toArray('LineImage', $this->LineImages);
        return empty($o) ? new class(){} : $o;
    }
}

class SchedulerConfiguration implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ConfigId=0,
        /** @var string|null */
        public ?string $SchedulerUrl=null,
        /** @var string|null */
        public ?string $SchedulerName=null,
        /** @var string|null */
        public ?string $DefaultLocation=null,
        /** @var string|null */
        public ?string $DefaultSummary=null,
        /** @var string|null */
        public ?string $DefaultDescription=null,
        /** @var DateInterval|null */
        public ?DateInterval $DayStart=null,
        /** @var string|null */
        public ?string $DayStartFriendly=null,
        /** @var DateInterval|null */
        public ?DateInterval $DayEnd=null,
        /** @var string|null */
        public ?string $DayEndFriendly=null,
        /** @var int */
        public int $TimeslotDuration=0,
        /** @var int|null */
        public ?int $NumberOfSlots=null,
        /** @var string */
        public string $LocationId='',
        /** @var string */
        public string $CalendarId='',
        /** @var int */
        public int $AgentId=0,
        /** @var string|null */
        public ?string $TimeZone=null,
        /** @var array<ScheduleConfigDay>|null */
        public ?array $AvailableDateTimes=null,
        /** @var array<string>|null */
        public ?array $AvailableServices=null,
        /** @var array<Line>|null */
        public ?array $AllServices=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ConfigId'])) $this->ConfigId = $o['ConfigId'];
        if (isset($o['SchedulerUrl'])) $this->SchedulerUrl = $o['SchedulerUrl'];
        if (isset($o['SchedulerName'])) $this->SchedulerName = $o['SchedulerName'];
        if (isset($o['DefaultLocation'])) $this->DefaultLocation = $o['DefaultLocation'];
        if (isset($o['DefaultSummary'])) $this->DefaultSummary = $o['DefaultSummary'];
        if (isset($o['DefaultDescription'])) $this->DefaultDescription = $o['DefaultDescription'];
        if (isset($o['DayStart'])) $this->DayStart = JsonConverters::from('DateInterval', $o['DayStart']);
        if (isset($o['DayStartFriendly'])) $this->DayStartFriendly = $o['DayStartFriendly'];
        if (isset($o['DayEnd'])) $this->DayEnd = JsonConverters::from('DateInterval', $o['DayEnd']);
        if (isset($o['DayEndFriendly'])) $this->DayEndFriendly = $o['DayEndFriendly'];
        if (isset($o['TimeslotDuration'])) $this->TimeslotDuration = $o['TimeslotDuration'];
        if (isset($o['NumberOfSlots'])) $this->NumberOfSlots = $o['NumberOfSlots'];
        if (isset($o['LocationId'])) $this->LocationId = $o['LocationId'];
        if (isset($o['CalendarId'])) $this->CalendarId = $o['CalendarId'];
        if (isset($o['AgentId'])) $this->AgentId = $o['AgentId'];
        if (isset($o['TimeZone'])) $this->TimeZone = $o['TimeZone'];
        if (isset($o['AvailableDateTimes'])) $this->AvailableDateTimes = JsonConverters::fromArray('ScheduleConfigDay', $o['AvailableDateTimes']);
        if (isset($o['AvailableServices'])) $this->AvailableServices = JsonConverters::fromArray('Guid', $o['AvailableServices']);
        if (isset($o['AllServices'])) $this->AllServices = JsonConverters::fromArray('Line', $o['AllServices']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ConfigId)) $o['ConfigId'] = $this->ConfigId;
        if (isset($this->SchedulerUrl)) $o['SchedulerUrl'] = $this->SchedulerUrl;
        if (isset($this->SchedulerName)) $o['SchedulerName'] = $this->SchedulerName;
        if (isset($this->DefaultLocation)) $o['DefaultLocation'] = $this->DefaultLocation;
        if (isset($this->DefaultSummary)) $o['DefaultSummary'] = $this->DefaultSummary;
        if (isset($this->DefaultDescription)) $o['DefaultDescription'] = $this->DefaultDescription;
        if (isset($this->DayStart)) $o['DayStart'] = JsonConverters::to('DateInterval', $this->DayStart);
        if (isset($this->DayStartFriendly)) $o['DayStartFriendly'] = $this->DayStartFriendly;
        if (isset($this->DayEnd)) $o['DayEnd'] = JsonConverters::to('DateInterval', $this->DayEnd);
        if (isset($this->DayEndFriendly)) $o['DayEndFriendly'] = $this->DayEndFriendly;
        if (isset($this->TimeslotDuration)) $o['TimeslotDuration'] = $this->TimeslotDuration;
        if (isset($this->NumberOfSlots)) $o['NumberOfSlots'] = $this->NumberOfSlots;
        if (isset($this->LocationId)) $o['LocationId'] = $this->LocationId;
        if (isset($this->CalendarId)) $o['CalendarId'] = $this->CalendarId;
        if (isset($this->AgentId)) $o['AgentId'] = $this->AgentId;
        if (isset($this->TimeZone)) $o['TimeZone'] = $this->TimeZone;
        if (isset($this->AvailableDateTimes)) $o['AvailableDateTimes'] = JsonConverters::toArray('ScheduleConfigDay', $this->AvailableDateTimes);
        if (isset($this->AvailableServices)) $o['AvailableServices'] = JsonConverters::toArray('Guid', $this->AvailableServices);
        if (isset($this->AllServices)) $o['AllServices'] = JsonConverters::toArray('Line', $this->AllServices);
        return empty($o) ? new class(){} : $o;
    }
}

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

GET /v1/Scheduler/Settings/{LocationId}/{AgentId}/{Mode} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ConfigId":0,"SchedulerUrl":"String","SchedulerName":"String","DefaultLocation":"String","DefaultSummary":"String","DefaultDescription":"String","DayStart":"PT0S","DayStartFriendly":"00:00","DayEnd":"PT0S","DayEndFriendly":"00:00","TimeslotDuration":0,"NumberOfSlots":0,"LocationId":"00000000000000000000000000000000","CalendarId":"00000000000000000000000000000000","AgentId":0,"TimeZone":"String","AvailableDateTimes":[{"DayName":"String","DayNumber":0,"DayEnabled":false,"TimeBlocks":[{"StartTime":"PT0S","DayStartFriendly":"00:00","EndTime":"PT0S","DayEndFriendly":"00:00"}]}],"AvailableServices":["00000000000000000000000000000000"],"AllServices":[{"Id":"00000000000000000000000000000000","LocationId":"00000000000000000000000000000000","LocationName":"String","Name":"String","Description":"String","ServiceDurationMinutes":0,"WaitTime":0,"Cost":0,"UpperThreshold":0,"LowerThreshold":0,"Active":false,"EntDate":"0001-01-01T00:00:00.0000000","ModDate":"0001-01-01T00:00:00.0000000","SendQuestionnaire":false,"RequireUpload":false,"UploadMessage":"String","LineImages":[{"ImageId":"00000000000000000000000000000000","FileName":"String","ImageTitle":"String","UploadDate":"0001-01-01T00:00:00.0000000"}]}]}