GET | /homepage/scheduler/settings | Get homepage scheduler settings |
---|
<?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 HomepageSchedulerServiceResponse implements JsonSerializable
{
public function __construct(
/** @description The service id. */
// @ApiMember(Description="The service id.")
/** @var int */
public int $Id=0,
/** @description The service name. */
// @ApiMember(Description="The service name.")
/** @var string|null */
public ?string $Name=null,
/** @description The service description. */
// @ApiMember(Description="The service description.")
/** @var string|null */
public ?string $Description=null,
/** @description The service image url. */
// @ApiMember(Description="The service image url.")
/** @var string|null */
public ?string $ImageUrl=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['ImageUrl'])) $this->ImageUrl = JsonConverters::from('string', $o['ImageUrl']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->ImageUrl)) $o['ImageUrl'] = JsonConverters::to('string', $this->ImageUrl);
return empty($o) ? new class(){} : $o;
}
}
class HomepageSchedulerResourceResponse implements JsonSerializable
{
public function __construct(
/** @description The resource id. */
// @ApiMember(Description="The resource id.")
/** @var int */
public int $Id=0,
/** @description The resource name. */
// @ApiMember(Description="The resource name.")
/** @var string|null */
public ?string $Name=null,
/** @description The resource description. */
// @ApiMember(Description="The resource description.")
/** @var string|null */
public ?string $Description=null,
/** @description The resource image url. */
// @ApiMember(Description="The resource image url.")
/** @var string|null */
public ?string $ImageUrl=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['ImageUrl'])) $this->ImageUrl = JsonConverters::from('string', $o['ImageUrl']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->ImageUrl)) $o['ImageUrl'] = JsonConverters::to('string', $this->ImageUrl);
return empty($o) ? new class(){} : $o;
}
}
class HomepageSchedulerFieldResponse implements JsonSerializable
{
public function __construct(
/** @description The field id. */
// @ApiMember(Description="The field id.")
/** @var int */
public int $Id=0,
/** @description If the field should be shown on booking. */
// @ApiMember(Description="If the field should be shown on booking.")
/** @var bool|null */
public ?bool $ShowOnBooking=null,
/** @description If the field should be shown on tooltip. */
// @ApiMember(Description="If the field should be shown on tooltip.")
/** @var bool|null */
public ?bool $ShowOnTooltip=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['ShowOnBooking'])) $this->ShowOnBooking = $o['ShowOnBooking'];
if (isset($o['ShowOnTooltip'])) $this->ShowOnTooltip = $o['ShowOnTooltip'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->ShowOnBooking)) $o['ShowOnBooking'] = $this->ShowOnBooking;
if (isset($this->ShowOnTooltip)) $o['ShowOnTooltip'] = $this->ShowOnTooltip;
return empty($o) ? new class(){} : $o;
}
}
class HomepageSchedulerFieldOptionsResponse implements JsonSerializable
{
public function __construct(
/** @description The field id. */
// @ApiMember(Description="The field id.")
/** @var int */
public int $Id=0,
/** @description The field name. */
// @ApiMember(Description="The field name.")
/** @var string|null */
public ?string $Name=null,
/** @description The field description. */
// @ApiMember(Description="The field description.")
/** @var string|null */
public ?string $Description=null,
/** @description The field sort order when listing. */
// @ApiMember(Description="The field sort order when listing.")
/** @var int */
public int $SortOrder=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['SortOrder'])) $this->SortOrder = $o['SortOrder'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->SortOrder)) $o['SortOrder'] = $this->SortOrder;
return empty($o) ? new class(){} : $o;
}
}
class ScheduleViewResponse implements JsonSerializable
{
public function __construct(
/** @var int */
public int $Id=0,
/** @var string|null */
public ?string $Name=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Name'])) $this->Name = $o['Name'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Name)) $o['Name'] = $this->Name;
return empty($o) ? new class(){} : $o;
}
}
class HomepageSchedulerSettingsQueryResponse implements JsonSerializable
{
public function __construct(
/** @description The company id. */
// @ApiMember(Description="The company id.")
/** @var string */
public string $CompanyId='',
/** @description If the user schedule is activated. */
// @ApiMember(Description="If the user schedule is activated.")
/** @var bool|null */
public ?bool $Active=null,
/** @description If the user schedule views id. */
// @ApiMember(Description="If the user schedule views id.")
/** @var int */
public int $ScheduleViewId=0,
/** @description If the user schedule time slots in minutes. */
// @ApiMember(Description="If the user schedule time slots in minutes.")
/** @var int */
public int $ScheduleTimeSlotMinutes=0,
/** @description If the user schedule time start time. */
// @ApiMember(Description="If the user schedule time start time.")
/** @var DateInterval|null */
public ?DateInterval $StartTime=null,
/** @description If the user schedule time end time. */
// @ApiMember(Description="If the user schedule time end time.")
/** @var DateInterval|null */
public ?DateInterval $EndTime=null,
/** @description If the user schedule should contain time exceptions. */
// @ApiMember(Description="If the user schedule should contain time exceptions.")
/** @var bool|null */
public ?bool $ShowTimeExceptions=null,
/** @description If allow booking in the scheduler. */
// @ApiMember(Description="If allow booking in the scheduler.")
/** @var bool|null */
public ?bool $EnableBooking=null,
/** @description The homepage schedule services that are selected */
// @ApiMember(Description="The homepage schedule services that are selected")
/** @var array<HomepageSchedulerServiceResponse>|null */
public ?array $Services=null,
/** @description The homepage schedule resources that are selected */
// @ApiMember(Description="The homepage schedule resources that are selected")
/** @var array<HomepageSchedulerResourceResponse>|null */
public ?array $Resources=null,
/** @description The homepage schedule fields that are selected */
// @ApiMember(Description="The homepage schedule fields that are selected")
/** @var array<HomepageSchedulerFieldResponse>|null */
public ?array $Fields=null,
/** @description The homepage schedule fields select from */
// @ApiMember(Description="The homepage schedule fields select from")
/** @var array<HomepageSchedulerFieldOptionsResponse>|null */
public ?array $FieldOptions=null,
/** @description The available schedule view options to choose from */
// @ApiMember(Description="The available schedule view options to choose from")
/** @var array<ScheduleViewResponse>|null */
public ?array $ScheduleViewOptions=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
if (isset($o['Active'])) $this->Active = $o['Active'];
if (isset($o['ScheduleViewId'])) $this->ScheduleViewId = $o['ScheduleViewId'];
if (isset($o['ScheduleTimeSlotMinutes'])) $this->ScheduleTimeSlotMinutes = $o['ScheduleTimeSlotMinutes'];
if (isset($o['StartTime'])) $this->StartTime = JsonConverters::from('TimeSpan', $o['StartTime']);
if (isset($o['EndTime'])) $this->EndTime = JsonConverters::from('TimeSpan', $o['EndTime']);
if (isset($o['ShowTimeExceptions'])) $this->ShowTimeExceptions = $o['ShowTimeExceptions'];
if (isset($o['EnableBooking'])) $this->EnableBooking = $o['EnableBooking'];
if (isset($o['Services'])) $this->Services = JsonConverters::fromArray('HomepageSchedulerServiceResponse', $o['Services']);
if (isset($o['Resources'])) $this->Resources = JsonConverters::fromArray('HomepageSchedulerResourceResponse', $o['Resources']);
if (isset($o['Fields'])) $this->Fields = JsonConverters::fromArray('HomepageSchedulerFieldResponse', $o['Fields']);
if (isset($o['FieldOptions'])) $this->FieldOptions = JsonConverters::fromArray('HomepageSchedulerFieldOptionsResponse', $o['FieldOptions']);
if (isset($o['ScheduleViewOptions'])) $this->ScheduleViewOptions = JsonConverters::fromArray('ScheduleViewResponse', $o['ScheduleViewOptions']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
if (isset($this->Active)) $o['Active'] = $this->Active;
if (isset($this->ScheduleViewId)) $o['ScheduleViewId'] = $this->ScheduleViewId;
if (isset($this->ScheduleTimeSlotMinutes)) $o['ScheduleTimeSlotMinutes'] = $this->ScheduleTimeSlotMinutes;
if (isset($this->StartTime)) $o['StartTime'] = JsonConverters::to('TimeSpan', $this->StartTime);
if (isset($this->EndTime)) $o['EndTime'] = JsonConverters::to('TimeSpan', $this->EndTime);
if (isset($this->ShowTimeExceptions)) $o['ShowTimeExceptions'] = $this->ShowTimeExceptions;
if (isset($this->EnableBooking)) $o['EnableBooking'] = $this->EnableBooking;
if (isset($this->Services)) $o['Services'] = JsonConverters::toArray('HomepageSchedulerServiceResponse', $this->Services);
if (isset($this->Resources)) $o['Resources'] = JsonConverters::toArray('HomepageSchedulerResourceResponse', $this->Resources);
if (isset($this->Fields)) $o['Fields'] = JsonConverters::toArray('HomepageSchedulerFieldResponse', $this->Fields);
if (isset($this->FieldOptions)) $o['FieldOptions'] = JsonConverters::toArray('HomepageSchedulerFieldOptionsResponse', $this->FieldOptions);
if (isset($this->ScheduleViewOptions)) $o['ScheduleViewOptions'] = JsonConverters::toArray('ScheduleViewResponse', $this->ScheduleViewOptions);
return empty($o) ? new class(){} : $o;
}
}
class HomepageSchedulerSettingsQuery implements ICompany, ICompanyRequest, JsonSerializable
{
public function __construct(
/** @description Enter the company you want to see news for, if blank and you are an admin, your company id will be used */
// @ApiMember(Description="Enter the company you want to see news for, if blank and you are an admin, your company id will be used", ParameterType="query")
/** @var string|null */
public ?string $CompanyId=null,
/** @description If you want to include the services that is connected */
// @ApiMember(DataType="boolean", Description="If you want to include the services that is connected", ParameterType="query")
/** @var bool|null */
public ?bool $IncludeServices=null,
/** @description If you want to include the resources that is connected */
// @ApiMember(DataType="boolean", Description="If you want to include the resources that is connected", ParameterType="query")
/** @var bool|null */
public ?bool $IncludeResources=null,
/** @description If you want to include the scheduler fields that is connected */
// @ApiMember(DataType="boolean", Description="If you want to include the scheduler fields that is connected", ParameterType="query")
/** @var bool|null */
public ?bool $IncludeFields=null,
/** @description If you want to include the service to select from */
// @ApiMember(DataType="boolean", Description="If you want to include the service to select from", ParameterType="query")
/** @var bool|null */
public ?bool $IncludeServiceOptions=null,
/** @description If you want to include the resources to select from */
// @ApiMember(DataType="boolean", Description="If you want to include the resources to select from", ParameterType="query")
/** @var bool|null */
public ?bool $IncludeResourceOptions=null,
/** @description If you want to include the scheduler fields to select from */
// @ApiMember(DataType="boolean", Description="If you want to include the scheduler fields to select from", ParameterType="query")
/** @var bool|null */
public ?bool $IncludeFieldOptions=null,
/** @description If you want to include the schedule views to select from */
// @ApiMember(DataType="boolean", Description="If you want to include the schedule views to select from", ParameterType="query")
/** @var bool|null */
public ?bool $IncludeScheduleViewOptions=null,
/** @description The homeage sitepath. */
// @ApiMember(Description="The homeage sitepath.")
/** @var string|null */
public ?string $SitePath=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
if (isset($o['IncludeServices'])) $this->IncludeServices = $o['IncludeServices'];
if (isset($o['IncludeResources'])) $this->IncludeResources = $o['IncludeResources'];
if (isset($o['IncludeFields'])) $this->IncludeFields = $o['IncludeFields'];
if (isset($o['IncludeServiceOptions'])) $this->IncludeServiceOptions = $o['IncludeServiceOptions'];
if (isset($o['IncludeResourceOptions'])) $this->IncludeResourceOptions = $o['IncludeResourceOptions'];
if (isset($o['IncludeFieldOptions'])) $this->IncludeFieldOptions = $o['IncludeFieldOptions'];
if (isset($o['IncludeScheduleViewOptions'])) $this->IncludeScheduleViewOptions = $o['IncludeScheduleViewOptions'];
if (isset($o['SitePath'])) $this->SitePath = $o['SitePath'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
if (isset($this->IncludeServices)) $o['IncludeServices'] = $this->IncludeServices;
if (isset($this->IncludeResources)) $o['IncludeResources'] = $this->IncludeResources;
if (isset($this->IncludeFields)) $o['IncludeFields'] = $this->IncludeFields;
if (isset($this->IncludeServiceOptions)) $o['IncludeServiceOptions'] = $this->IncludeServiceOptions;
if (isset($this->IncludeResourceOptions)) $o['IncludeResourceOptions'] = $this->IncludeResourceOptions;
if (isset($this->IncludeFieldOptions)) $o['IncludeFieldOptions'] = $this->IncludeFieldOptions;
if (isset($this->IncludeScheduleViewOptions)) $o['IncludeScheduleViewOptions'] = $this->IncludeScheduleViewOptions;
if (isset($this->SitePath)) $o['SitePath'] = $this->SitePath;
return empty($o) ? new class(){} : $o;
}
}
PHP HomepageSchedulerSettingsQuery DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /homepage/scheduler/settings HTTP/1.1 Host: testapi.bokamera.se Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <HomepageSchedulerSettingsQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <Active>false</Active> <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId> <EnableBooking>false</EnableBooking> <EndTime>PT0S</EndTime> <FieldOptions> <HomepageSchedulerFieldOptionsResponse> <Description>String</Description> <Id>0</Id> <Name>String</Name> <SortOrder>0</SortOrder> </HomepageSchedulerFieldOptionsResponse> </FieldOptions> <Fields> <HomepageSchedulerFieldResponse> <Id>0</Id> <ShowOnBooking>false</ShowOnBooking> <ShowOnTooltip>false</ShowOnTooltip> </HomepageSchedulerFieldResponse> </Fields> <Resources> <HomepageSchedulerResourceResponse> <Description>String</Description> <Id>0</Id> <ImageUrl i:nil="true" /> <Name>String</Name> </HomepageSchedulerResourceResponse> </Resources> <ScheduleTimeSlotMinutes>0</ScheduleTimeSlotMinutes> <ScheduleViewId>0</ScheduleViewId> <ScheduleViewOptions> <ScheduleViewResponse> <Id>0</Id> <Name>String</Name> </ScheduleViewResponse> </ScheduleViewOptions> <Services> <HomepageSchedulerServiceResponse> <Description>String</Description> <Id>0</Id> <ImageUrl i:nil="true" /> <Name>String</Name> </HomepageSchedulerServiceResponse> </Services> <ShowTimeExceptions>false</ShowTimeExceptions> <StartTime>PT0S</StartTime> </HomepageSchedulerSettingsQueryResponse>