BokaMera.API.Host

<back to all web services

CreateBooking

The following routes are available for this service:
POST/bookingsCreate a new bookingCreate a new booking if you are authorized to do so.
<?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 CustomerToBook implements JsonSerializable
{
    public function __construct(
        /** @description Customers firstname */
        // @ApiMember(Description="Customers firstname", IsRequired=true)
        /** @var string */
        public string $Firstname='',

        /** @description Customers lastname */
        // @ApiMember(Description="Customers lastname", IsRequired=true)
        /** @var string */
        public string $Lastname='',

        /** @description Customers email */
        // @ApiMember(Description="Customers email", IsRequired=true)
        /** @var string */
        public string $Email='',

        /** @description Customers phone number. Mobile phone number is required for SMS messages to be sent. */
        // @ApiMember(Description="Customers phone number. Mobile phone number is required for SMS messages to be sent.", IsRequired=true)
        /** @var string */
        public string $Phone=''
    ) {
    }

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

class ResourceToBook implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ResourceTypeId=0,
        /** @var int */
        public int $ResourceId=0
    ) {
    }

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

enum PaymentOptions : string
{
    case DefaultSetting = 'DefaultSetting';
    case BookWithoutPayment = 'BookWithoutPayment';
    case BookWithPaymentMessageToCustomer = 'BookWithPaymentMessageToCustomer';
    case BookWithManualPayment = 'BookWithManualPayment';
}

class AddCustomField implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Value=null
    ) {
    }

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

class CreateBookingBase implements JsonSerializable
{
    public function __construct(
        /** @description The company id, if empty will use the company id for the user you are logged in with. */
        // @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
        /** @var string|null */
        public ?string $CompanyId=null,

        /** @description If you want to book on an existing customer instead of CustomerToBook info set the CustomerId here. Set Empty Guid (00000000-0000-0000-0000-000000000000) if you want to book without any customer, this is only allowed by admin. The customer id is shown in the customer list named as id. When booking as customer (no admin) leave this field blank. */
        // @ApiMember(Description="If you want to book on an existing customer instead of CustomerToBook info set the CustomerId here. Set Empty Guid (00000000-0000-0000-0000-000000000000) if you want to book without any customer, this is only allowed by admin. The customer id is shown in the customer list named as id. When booking as customer (no admin) leave this field blank.")
        /** @var string|null */
        public ?string $CustomerId=null,

        /** @description If company requires to be authenticated or a pin code entered to book on a specific customer, enter it here. */
        // @ApiMember(Description="If company requires to be authenticated or a pin code entered to book on a specific customer, enter it here.")
        /** @var string|null */
        public ?string $PinCode=null,

        /** @description If you want to book with customer information instead of the Customer Id send the customer information here. Note: If customer profile already exists with the same email the information will not be changed, instead the provided information will be added as BookingsComments if it differs from the ordinairy profile.  */
        // @ApiMember(Description="If you want to book with customer information instead of the Customer Id send the customer information here. Note: If customer profile already exists with the same email the information will not be changed, instead the provided information will be added as BookingsComments if it differs from the ordinairy profile. ")
        /** @var CustomerToBook|null */
        public ?CustomerToBook $Customer=null,

        /** @description The service to be booked */
        // @ApiMember(Description="The service to be booked", IsRequired=true)
        /** @var int */
        public int $ServiceId=0,

        /** @description If you want to add comments to a booking you can add them here, this comments are never shared with the customer */
        // @ApiMember(Description="If you want to add comments to a booking you can add them here, this comments are never shared with the customer")
        /** @var string|null */
        public ?string $BookedComments=null,

        /** @description If you want to add comments to the booking that is sent to the customer, you can add them here. Comments will be sent in the booking confirmation */
        // @ApiMember(Description="If you want to add comments to the booking that is sent to the customer, you can add them here. Comments will be sent in the booking confirmation")
        /** @var string|null */
        public ?string $CommentsToCustomer=null,

        /** @var array<ResourceToBook>|null */
        public ?array $Resources=null,
        /** @description Rebate code ids as an array of integer */
        // @ApiMember(Description="Rebate code ids as an array of integer")
        /** @var array<int>|null */
        public ?array $RebateCodeIds=null,

        /** @description If you want to send Email reminder */
        // @ApiMember(Description="If you want to send Email reminder")
        /** @var bool|null */
        public ?bool $SendEmailReminder=null,

        /** @description If you want to send SMS reminder */
        // @ApiMember(Description="If you want to send SMS reminder")
        /** @var bool|null */
        public ?bool $SendSmsReminder=null,

        /** @description If you want to send SMS confirmation */
        // @ApiMember(Description="If you want to send SMS confirmation")
        /** @var bool|null */
        public ?bool $SendSmsConfirmation=null,

        /** @description Only admins are allowed to not send an email confirmation. Default is true */
        // @ApiMember(Description="Only admins are allowed to not send an email confirmation. Default is true")
        /** @var bool|null */
        public ?bool $SendEmailConfirmation=null,

        /** @description If payment is enabled and you're an administrator, optional to choose payment option, if empty then the default settings will be used. Following payment options exists. DefaultSetting = 0, BookWithoutPayment = 1 (will be direcyly booked without payment), BookWithPaymentMessageToCustomer = 2 (will set status AwaitingPayment and send payment instructions to customer), BookWithManualPayment = 3 (Will set status AwaitingPaymentNoTimeLimit and Admin will need to manually mark the booking as payed when recieved payment). */
        // @ApiMember(Description="If payment is enabled and you're an administrator, optional to choose payment option, if empty then the default settings will be used. Following payment options exists. DefaultSetting = 0, BookWithoutPayment = 1 (will be direcyly booked without payment), BookWithPaymentMessageToCustomer = 2 (will set status AwaitingPayment and send payment instructions to customer), BookWithManualPayment = 3 (Will set status AwaitingPaymentNoTimeLimit and Admin will need to manually mark the booking as payed when recieved payment).")
        /** @var PaymentOptions|null */
        public ?PaymentOptions $PaymentOption=null,

        /** @description If Custom Fields are added to the booking, here you will send the id and the value for each custom field to be saved */
        // @ApiMember(Description="If Custom Fields are added to the booking, here you will send the id and the value for each custom field to be saved")
        /** @var array<AddCustomField>|null */
        public ?array $CustomFields=null,

        /** @description If Custom Fields are added to the customer, here you will send the id and the value for each custom field to be updated */
        // @ApiMember(Description="If Custom Fields are added to the customer, here you will send the id and the value for each custom field to be updated")
        /** @var array<AddCustomField>|null */
        public ?array $CustomerCustomFields=null,

        /** @description If want to allow to book outside the service schedules. This means you can book a time after the schedule opening hours as long as the resource are available. This is only allowed by administrators */
        // @ApiMember(Description="If want to allow to book outside the service schedules. This means you can book a time after the schedule opening hours as long as the resource are available. This is only allowed by administrators")
        /** @var bool|null */
        public ?bool $AllowBookingOutsideSchedules=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['CustomerId'])) $this->CustomerId = $o['CustomerId'];
        if (isset($o['PinCode'])) $this->PinCode = $o['PinCode'];
        if (isset($o['Customer'])) $this->Customer = JsonConverters::from('CustomerToBook', $o['Customer']);
        if (isset($o['ServiceId'])) $this->ServiceId = $o['ServiceId'];
        if (isset($o['BookedComments'])) $this->BookedComments = $o['BookedComments'];
        if (isset($o['CommentsToCustomer'])) $this->CommentsToCustomer = $o['CommentsToCustomer'];
        if (isset($o['Resources'])) $this->Resources = JsonConverters::fromArray('ResourceToBook', $o['Resources']);
        if (isset($o['RebateCodeIds'])) $this->RebateCodeIds = JsonConverters::fromArray('int', $o['RebateCodeIds']);
        if (isset($o['SendEmailReminder'])) $this->SendEmailReminder = $o['SendEmailReminder'];
        if (isset($o['SendSmsReminder'])) $this->SendSmsReminder = $o['SendSmsReminder'];
        if (isset($o['SendSmsConfirmation'])) $this->SendSmsConfirmation = $o['SendSmsConfirmation'];
        if (isset($o['SendEmailConfirmation'])) $this->SendEmailConfirmation = $o['SendEmailConfirmation'];
        if (isset($o['PaymentOption'])) $this->PaymentOption = JsonConverters::from('PaymentOptions', $o['PaymentOption']);
        if (isset($o['CustomFields'])) $this->CustomFields = JsonConverters::fromArray('AddCustomField', $o['CustomFields']);
        if (isset($o['CustomerCustomFields'])) $this->CustomerCustomFields = JsonConverters::fromArray('AddCustomField', $o['CustomerCustomFields']);
        if (isset($o['AllowBookingOutsideSchedules'])) $this->AllowBookingOutsideSchedules = $o['AllowBookingOutsideSchedules'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->CustomerId)) $o['CustomerId'] = $this->CustomerId;
        if (isset($this->PinCode)) $o['PinCode'] = $this->PinCode;
        if (isset($this->Customer)) $o['Customer'] = JsonConverters::to('CustomerToBook', $this->Customer);
        if (isset($this->ServiceId)) $o['ServiceId'] = $this->ServiceId;
        if (isset($this->BookedComments)) $o['BookedComments'] = $this->BookedComments;
        if (isset($this->CommentsToCustomer)) $o['CommentsToCustomer'] = $this->CommentsToCustomer;
        if (isset($this->Resources)) $o['Resources'] = JsonConverters::toArray('ResourceToBook', $this->Resources);
        if (isset($this->RebateCodeIds)) $o['RebateCodeIds'] = JsonConverters::toArray('int', $this->RebateCodeIds);
        if (isset($this->SendEmailReminder)) $o['SendEmailReminder'] = $this->SendEmailReminder;
        if (isset($this->SendSmsReminder)) $o['SendSmsReminder'] = $this->SendSmsReminder;
        if (isset($this->SendSmsConfirmation)) $o['SendSmsConfirmation'] = $this->SendSmsConfirmation;
        if (isset($this->SendEmailConfirmation)) $o['SendEmailConfirmation'] = $this->SendEmailConfirmation;
        if (isset($this->PaymentOption)) $o['PaymentOption'] = JsonConverters::to('PaymentOptions', $this->PaymentOption);
        if (isset($this->CustomFields)) $o['CustomFields'] = JsonConverters::toArray('AddCustomField', $this->CustomFields);
        if (isset($this->CustomerCustomFields)) $o['CustomerCustomFields'] = JsonConverters::toArray('AddCustomField', $this->CustomerCustomFields);
        if (isset($this->AllowBookingOutsideSchedules)) $o['AllowBookingOutsideSchedules'] = $this->AllowBookingOutsideSchedules;
        return empty($o) ? new class(){} : $o;
    }
}

enum BookingStatusEnum : int
{
    case Booked = 1;
    case Unbooked = 2;
    case Reserved = 3;
    case Canceled = 4;
    case AwaitingPayment = 5;
    case AwaitingPaymentNoTimeLimit = 6;
    case Payed = 7;
    case AwaitingPaymentRequestFromAdmin = 8;
    case AwaitingPaymentFromProvider = 9;
    case Invoiced = 10;
}

class BookingStatusQueryResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $Icon=null,
        /** @var string|null */
        public ?string $Color=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['Icon'])) $this->Icon = $o['Icon'];
        if (isset($o['Color'])) $this->Color = $o['Color'];
    }
    
    /** @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->Icon)) $o['Icon'] = $this->Icon;
        if (isset($this->Color)) $o['Color'] = $this->Color;
        return empty($o) ? new class(){} : $o;
    }
}

class CustomFieldValueResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Value=null
    ) {
    }

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

class CustomFieldConfigData implements JsonSerializable
{
    public function __construct(
        /** @description Custom field id */
        // @ApiMember(Description="Custom field id")
        /** @var int */
        public int $Id=0,

        /** @description Configuration name. Example: 'Number of persons'. */
        // @ApiMember(Description="Configuration name. Example: 'Number of persons'.")
        /** @var string|null */
        public ?string $Name=null,

        /** @description Custom field description. Example: 'For how many persons is this booking?' */
        // @ApiMember(Description="Custom field description. Example: 'For how many persons is this booking?'")
        /** @var string|null */
        public ?string $Description=null,

        /** @description Field width. Example: 20 for 20px */
        // @ApiMember(Description="Field width. Example: 20 for 20px")
        /** @var int|null */
        public ?int $Width=null,

        /** @description Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox' */
        // @ApiMember(Description="Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'")
        /** @var string|null */
        public ?string $DataType=null,

        /** @description Default value of the field. Example: '3' */
        // @ApiMember(Description="Default value of the field. Example: '3'")
        /** @var string|null */
        public ?string $DefaultValue=null,

        /** @description Determines if the field is required to have a value or not */
        // @ApiMember(Description="Determines if the field is required to have a value or not")
        /** @var bool|null */
        public ?bool $IsMandatory=null,

        /** @description Error message shown to the user if the field data is required but not entered */
        // @ApiMember(Description="Error message shown to the user if the field data is required but not entered")
        /** @var string|null */
        public ?string $MandatoryErrorMessage=null,

        /** @description Max lenght of the field */
        // @ApiMember(Description="Max lenght of the field")
        /** @var int */
        public int $MaxLength=0,

        /** @description If the field should have multiple lines */
        // @ApiMember(Description="If the field should have multiple lines")
        /** @var bool|null */
        public ?bool $MultipleLineText=null,

        /** @description Regular expression used for validation of the field */
        // @ApiMember(Description="Regular expression used for validation of the field")
        /** @var string|null */
        public ?string $RegEx=null,

        /** @description Error message shown if the regular expression validation failed */
        // @ApiMember(Description="Error message shown if the regular expression validation failed")
        /** @var string|null */
        public ?string $RegExErrorMessage=null,

        /** @description The values to select from if Datatype is DropDown for this custom field */
        // @ApiMember(Description="The values to select from if Datatype is DropDown for this custom field")
        /** @var array<CustomFieldValueResponse>|null */
        public ?array $Values=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['Width'])) $this->Width = $o['Width'];
        if (isset($o['DataType'])) $this->DataType = $o['DataType'];
        if (isset($o['DefaultValue'])) $this->DefaultValue = $o['DefaultValue'];
        if (isset($o['IsMandatory'])) $this->IsMandatory = $o['IsMandatory'];
        if (isset($o['MandatoryErrorMessage'])) $this->MandatoryErrorMessage = $o['MandatoryErrorMessage'];
        if (isset($o['MaxLength'])) $this->MaxLength = $o['MaxLength'];
        if (isset($o['MultipleLineText'])) $this->MultipleLineText = $o['MultipleLineText'];
        if (isset($o['RegEx'])) $this->RegEx = $o['RegEx'];
        if (isset($o['RegExErrorMessage'])) $this->RegExErrorMessage = $o['RegExErrorMessage'];
        if (isset($o['Values'])) $this->Values = JsonConverters::fromArray('CustomFieldValueResponse', $o['Values']);
    }
    
    /** @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->Width)) $o['Width'] = $this->Width;
        if (isset($this->DataType)) $o['DataType'] = $this->DataType;
        if (isset($this->DefaultValue)) $o['DefaultValue'] = $this->DefaultValue;
        if (isset($this->IsMandatory)) $o['IsMandatory'] = $this->IsMandatory;
        if (isset($this->MandatoryErrorMessage)) $o['MandatoryErrorMessage'] = $this->MandatoryErrorMessage;
        if (isset($this->MaxLength)) $o['MaxLength'] = $this->MaxLength;
        if (isset($this->MultipleLineText)) $o['MultipleLineText'] = $this->MultipleLineText;
        if (isset($this->RegEx)) $o['RegEx'] = $this->RegEx;
        if (isset($this->RegExErrorMessage)) $o['RegExErrorMessage'] = $this->RegExErrorMessage;
        if (isset($this->Values)) $o['Values'] = JsonConverters::toArray('CustomFieldValueResponse', $this->Values);
        return empty($o) ? new class(){} : $o;
    }
}

class CustomFieldDataResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Column=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $Value=null,
        /** @description Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox' */
        // @ApiMember(Description="Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'")
        /** @var string|null */
        public ?string $DataType=null
    ) {
    }

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

class BookedResource implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Color=null,
        /** @var string|null */
        public ?string $ImageUrl=null,
        /** @var string|null */
        public ?string $Email=null,
        /** @var string|null */
        public ?string $MobilePhone=null,
        /** @var string|null */
        public ?string $AccessGroup=null,
        /** @var bool|null */
        public ?bool $EmailNotification=null,
        /** @var bool|null */
        public ?bool $SMSNotification=null,
        /** @var bool|null */
        public ?bool $EmailReminder=null,
        /** @var bool|null */
        public ?bool $SMSReminder=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['Color'])) $this->Color = $o['Color'];
        if (isset($o['ImageUrl'])) $this->ImageUrl = JsonConverters::from('string', $o['ImageUrl']);
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['MobilePhone'])) $this->MobilePhone = $o['MobilePhone'];
        if (isset($o['AccessGroup'])) $this->AccessGroup = $o['AccessGroup'];
        if (isset($o['EmailNotification'])) $this->EmailNotification = $o['EmailNotification'];
        if (isset($o['SMSNotification'])) $this->SMSNotification = $o['SMSNotification'];
        if (isset($o['EmailReminder'])) $this->EmailReminder = $o['EmailReminder'];
        if (isset($o['SMSReminder'])) $this->SMSReminder = $o['SMSReminder'];
    }
    
    /** @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->Color)) $o['Color'] = $this->Color;
        if (isset($this->ImageUrl)) $o['ImageUrl'] = JsonConverters::to('string', $this->ImageUrl);
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->MobilePhone)) $o['MobilePhone'] = $this->MobilePhone;
        if (isset($this->AccessGroup)) $o['AccessGroup'] = $this->AccessGroup;
        if (isset($this->EmailNotification)) $o['EmailNotification'] = $this->EmailNotification;
        if (isset($this->SMSNotification)) $o['SMSNotification'] = $this->SMSNotification;
        if (isset($this->EmailReminder)) $o['EmailReminder'] = $this->EmailReminder;
        if (isset($this->SMSReminder)) $o['SMSReminder'] = $this->SMSReminder;
        return empty($o) ? new class(){} : $o;
    }
}

class BookedResourceType implements JsonSerializable
{
    public function __construct(
        /** @description The resource type id */
        // @ApiMember(Description="The resource type id")
        /** @var int */
        public int $Id=0,

        /** @description The resource type name */
        // @ApiMember(Description="The resource type name")
        /** @var string|null */
        public ?string $Name=null,

        /** @description The resources inside resource type */
        // @ApiMember(Description="The resources inside resource type")
        /** @var array<BookedResource>|null */
        public ?array $Resources=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['Resources'])) $this->Resources = JsonConverters::fromArray('BookedResource', $o['Resources']);
    }
    
    /** @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->Resources)) $o['Resources'] = JsonConverters::toArray('BookedResource', $this->Resources);
        return empty($o) ? new class(){} : $o;
    }
}

class BookedCompany implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Id='',
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $LogoType=null,
        /** @var string|null */
        public ?string $Category=null,
        /** @var string|null */
        public ?string $Street1=null,
        /** @var string|null */
        public ?string $Street2=null,
        /** @var string|null */
        public ?string $ZipCode=null,
        /** @var string|null */
        public ?string $City=null,
        /** @var string|null */
        public ?string $CountryId=null,
        /** @var string|null */
        public ?string $Longitude=null,
        /** @var string|null */
        public ?string $Latitude=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var string|null */
        public ?string $Email=null,
        /** @var string|null */
        public ?string $HomePage=null,
        /** @var string|null */
        public ?string $SitePath=null,
        /** @var bool|null */
        public ?bool $IsFavorite=null,
        /** @var int|null */
        public ?int $PaymentProviderId=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['LogoType'])) $this->LogoType = JsonConverters::from('string', $o['LogoType']);
        if (isset($o['Category'])) $this->Category = $o['Category'];
        if (isset($o['Street1'])) $this->Street1 = $o['Street1'];
        if (isset($o['Street2'])) $this->Street2 = $o['Street2'];
        if (isset($o['ZipCode'])) $this->ZipCode = $o['ZipCode'];
        if (isset($o['City'])) $this->City = $o['City'];
        if (isset($o['CountryId'])) $this->CountryId = $o['CountryId'];
        if (isset($o['Longitude'])) $this->Longitude = $o['Longitude'];
        if (isset($o['Latitude'])) $this->Latitude = $o['Latitude'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['HomePage'])) $this->HomePage = $o['HomePage'];
        if (isset($o['SitePath'])) $this->SitePath = $o['SitePath'];
        if (isset($o['IsFavorite'])) $this->IsFavorite = $o['IsFavorite'];
        if (isset($o['PaymentProviderId'])) $this->PaymentProviderId = $o['PaymentProviderId'];
    }
    
    /** @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->LogoType)) $o['LogoType'] = JsonConverters::to('string', $this->LogoType);
        if (isset($this->Category)) $o['Category'] = $this->Category;
        if (isset($this->Street1)) $o['Street1'] = $this->Street1;
        if (isset($this->Street2)) $o['Street2'] = $this->Street2;
        if (isset($this->ZipCode)) $o['ZipCode'] = $this->ZipCode;
        if (isset($this->City)) $o['City'] = $this->City;
        if (isset($this->CountryId)) $o['CountryId'] = $this->CountryId;
        if (isset($this->Longitude)) $o['Longitude'] = $this->Longitude;
        if (isset($this->Latitude)) $o['Latitude'] = $this->Latitude;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->HomePage)) $o['HomePage'] = $this->HomePage;
        if (isset($this->SitePath)) $o['SitePath'] = $this->SitePath;
        if (isset($this->IsFavorite)) $o['IsFavorite'] = $this->IsFavorite;
        if (isset($this->PaymentProviderId)) $o['PaymentProviderId'] = $this->PaymentProviderId;
        return empty($o) ? new class(){} : $o;
    }
}

class BookedCustomer implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Id='',
        /** @var string|null */
        public ?string $Firstname=null,
        /** @var string|null */
        public ?string $Lastname=null,
        /** @var string|null */
        public ?string $Email=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var string|null */
        public ?string $FacebookUserName=null,
        /** @var string|null */
        public ?string $ImageUrl=null,
        /** @var string|null */
        public ?string $CorporateIdentityNumber=null,
        /** @var string|null */
        public ?string $InvoiceAddress1=null,
        /** @var string|null */
        public ?string $InvoiceAddress2=null,
        /** @var string|null */
        public ?string $InvoiceCity=null,
        /** @var string|null */
        public ?string $InvoicePostalCode=null,
        /** @var string|null */
        public ?string $InvoiceCountryCode=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Firstname'])) $this->Firstname = $o['Firstname'];
        if (isset($o['Lastname'])) $this->Lastname = $o['Lastname'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['FacebookUserName'])) $this->FacebookUserName = $o['FacebookUserName'];
        if (isset($o['ImageUrl'])) $this->ImageUrl = $o['ImageUrl'];
        if (isset($o['CorporateIdentityNumber'])) $this->CorporateIdentityNumber = $o['CorporateIdentityNumber'];
        if (isset($o['InvoiceAddress1'])) $this->InvoiceAddress1 = $o['InvoiceAddress1'];
        if (isset($o['InvoiceAddress2'])) $this->InvoiceAddress2 = $o['InvoiceAddress2'];
        if (isset($o['InvoiceCity'])) $this->InvoiceCity = $o['InvoiceCity'];
        if (isset($o['InvoicePostalCode'])) $this->InvoicePostalCode = $o['InvoicePostalCode'];
        if (isset($o['InvoiceCountryCode'])) $this->InvoiceCountryCode = $o['InvoiceCountryCode'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Firstname)) $o['Firstname'] = $this->Firstname;
        if (isset($this->Lastname)) $o['Lastname'] = $this->Lastname;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->FacebookUserName)) $o['FacebookUserName'] = $this->FacebookUserName;
        if (isset($this->ImageUrl)) $o['ImageUrl'] = $this->ImageUrl;
        if (isset($this->CorporateIdentityNumber)) $o['CorporateIdentityNumber'] = $this->CorporateIdentityNumber;
        if (isset($this->InvoiceAddress1)) $o['InvoiceAddress1'] = $this->InvoiceAddress1;
        if (isset($this->InvoiceAddress2)) $o['InvoiceAddress2'] = $this->InvoiceAddress2;
        if (isset($this->InvoiceCity)) $o['InvoiceCity'] = $this->InvoiceCity;
        if (isset($this->InvoicePostalCode)) $o['InvoicePostalCode'] = $this->InvoicePostalCode;
        if (isset($this->InvoiceCountryCode)) $o['InvoiceCountryCode'] = $this->InvoiceCountryCode;
        return empty($o) ? new class(){} : $o;
    }
}

class BookedQuantity implements JsonSerializable
{
    public function __construct(
        /** @description The quantity Id */
        // @ApiMember(Description="The quantity Id")
        /** @var int */
        public int $Id=0,

        /** @description The quantity for booked on this price category */
        // @ApiMember(Description="The quantity for booked on this price category")
        /** @var int */
        public int $Quantity=0,

        /** @description The price */
        // @ApiMember(Description="The price")
        /** @var float|null */
        public ?float $Price=null,

        /** @description The price bofore rebate codes */
        // @ApiMember(Description="The price bofore rebate codes")
        /** @var float|null */
        public ?float $PriceBeforeRebate=null,

        /** @description The price currency */
        // @ApiMember(Description="The price currency")
        /** @var string|null */
        public ?string $CurrencyId=null,

        /** @description The price sign */
        // @ApiMember(Description="The price sign")
        /** @var string|null */
        public ?string $PriceSign=null,

        /** @description The price category */
        // @ApiMember(Description="The price category")
        /** @var string|null */
        public ?string $Category=null,

        /** @description The price VAT in percent */
        // @ApiMember(Description="The price VAT in percent")
        /** @var float|null */
        public ?float $VAT=null,

        /** @description The price text to display */
        // @ApiMember(Description="The price text to display")
        /** @var string|null */
        public ?string $PriceText=null,

        /** @description If the quantity you add should occupy a spot. Default is true. If no it will only be a row that includes price information. */
        // @ApiMember(Description="If the quantity you add should occupy a spot. Default is true. If no it will only be a row that includes price information.")
        /** @var bool|null */
        public ?bool $OccupiesSpot=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Quantity'])) $this->Quantity = $o['Quantity'];
        if (isset($o['Price'])) $this->Price = $o['Price'];
        if (isset($o['PriceBeforeRebate'])) $this->PriceBeforeRebate = $o['PriceBeforeRebate'];
        if (isset($o['CurrencyId'])) $this->CurrencyId = $o['CurrencyId'];
        if (isset($o['PriceSign'])) $this->PriceSign = $o['PriceSign'];
        if (isset($o['Category'])) $this->Category = $o['Category'];
        if (isset($o['VAT'])) $this->VAT = $o['VAT'];
        if (isset($o['PriceText'])) $this->PriceText = $o['PriceText'];
        if (isset($o['OccupiesSpot'])) $this->OccupiesSpot = $o['OccupiesSpot'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Quantity)) $o['Quantity'] = $this->Quantity;
        if (isset($this->Price)) $o['Price'] = $this->Price;
        if (isset($this->PriceBeforeRebate)) $o['PriceBeforeRebate'] = $this->PriceBeforeRebate;
        if (isset($this->CurrencyId)) $o['CurrencyId'] = $this->CurrencyId;
        if (isset($this->PriceSign)) $o['PriceSign'] = $this->PriceSign;
        if (isset($this->Category)) $o['Category'] = $this->Category;
        if (isset($this->VAT)) $o['VAT'] = $this->VAT;
        if (isset($this->PriceText)) $o['PriceText'] = $this->PriceText;
        if (isset($this->OccupiesSpot)) $o['OccupiesSpot'] = $this->OccupiesSpot;
        return empty($o) ? new class(){} : $o;
    }
}

class GroupBookingSettings implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Active=null,
        /** @var int */
        public int $Min=0,
        /** @var int */
        public int $Max=0
    ) {
    }

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

class MultipleResourceSettings implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Active=null,
        /** @var int */
        public int $Min=0,
        /** @var int */
        public int $Max=0
    ) {
    }

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

class ServiceInfoResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $ImageUrl=null,
        /** @var int|null */
        public ?int $LengthInMinutes=null,
        /** @var int */
        public int $MaxNumberOfSpotsPerBooking=0,
        /** @var GroupBookingSettings|null */
        public ?GroupBookingSettings $GroupBooking=null,
        /** @var MultipleResourceSettings|null */
        public ?MultipleResourceSettings $MultipleResource=null,
        /** @var bool|null */
        public ?bool $IsGroupBooking=null,
        /** @var bool|null */
        public ?bool $IsPaymentEnabled=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']);
        if (isset($o['LengthInMinutes'])) $this->LengthInMinutes = $o['LengthInMinutes'];
        if (isset($o['MaxNumberOfSpotsPerBooking'])) $this->MaxNumberOfSpotsPerBooking = $o['MaxNumberOfSpotsPerBooking'];
        if (isset($o['GroupBooking'])) $this->GroupBooking = JsonConverters::from('GroupBookingSettings', $o['GroupBooking']);
        if (isset($o['MultipleResource'])) $this->MultipleResource = JsonConverters::from('MultipleResourceSettings', $o['MultipleResource']);
        if (isset($o['IsGroupBooking'])) $this->IsGroupBooking = $o['IsGroupBooking'];
        if (isset($o['IsPaymentEnabled'])) $this->IsPaymentEnabled = $o['IsPaymentEnabled'];
    }
    
    /** @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);
        if (isset($this->LengthInMinutes)) $o['LengthInMinutes'] = $this->LengthInMinutes;
        if (isset($this->MaxNumberOfSpotsPerBooking)) $o['MaxNumberOfSpotsPerBooking'] = $this->MaxNumberOfSpotsPerBooking;
        if (isset($this->GroupBooking)) $o['GroupBooking'] = JsonConverters::to('GroupBookingSettings', $this->GroupBooking);
        if (isset($this->MultipleResource)) $o['MultipleResource'] = JsonConverters::to('MultipleResourceSettings', $this->MultipleResource);
        if (isset($this->IsGroupBooking)) $o['IsGroupBooking'] = $this->IsGroupBooking;
        if (isset($this->IsPaymentEnabled)) $o['IsPaymentEnabled'] = $this->IsPaymentEnabled;
        return empty($o) ? new class(){} : $o;
    }
}

class BookingLogEventTypeResponse implements JsonSerializable
{
    public function __construct(
        /** @description The event type id */
        // @ApiMember(Description="The event type id")
        /** @var int */
        public int $Id=0,

        /** @description The event type name */
        // @ApiMember(Description="The event type name")
        /** @var string|null */
        public ?string $Name=null,

        /** @description The event type description */
        // @ApiMember(Description="The event type description")
        /** @var string|null */
        public ?string $Description=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'];
    }
    
    /** @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;
        return empty($o) ? new class(){} : $o;
    }
}

class BookingLogQueryResponse implements JsonSerializable
{
    public function __construct(
        /** @description The booking log id */
        // @ApiMember(Description="The booking log id")
        /** @var int */
        public int $Id=0,

        /** @description The booking id */
        // @ApiMember(Description="The booking id")
        /** @var int */
        public int $BookingId=0,

        /** @description The type of event */
        // @ApiMember(Description="The type of event")
        /** @var int */
        public int $EventTypeId=0,

        /** @description The type of event */
        // @ApiMember(Description="The type of event")
        /** @var BookingLogEventTypeResponse|null */
        public ?BookingLogEventTypeResponse $EventType=null,

        /** @description Comments that could be added to the event log item */
        // @ApiMember(Description="Comments that could be added to the event log item")
        /** @var string|null */
        public ?string $Comments=null,

        /** @description The user created the event */
        // @ApiMember(Description="The user created the event")
        /** @var string|null */
        public ?string $UserName=null,

        /** @description Then date when the event occured */
        // @ApiMember(Description="Then date when the event occured")
        /** @var DateTime */
        public DateTime $Created=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['BookingId'])) $this->BookingId = $o['BookingId'];
        if (isset($o['EventTypeId'])) $this->EventTypeId = $o['EventTypeId'];
        if (isset($o['EventType'])) $this->EventType = JsonConverters::from('BookingLogEventTypeResponse', $o['EventType']);
        if (isset($o['Comments'])) $this->Comments = $o['Comments'];
        if (isset($o['UserName'])) $this->UserName = $o['UserName'];
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->BookingId)) $o['BookingId'] = $this->BookingId;
        if (isset($this->EventTypeId)) $o['EventTypeId'] = $this->EventTypeId;
        if (isset($this->EventType)) $o['EventType'] = JsonConverters::to('BookingLogEventTypeResponse', $this->EventType);
        if (isset($this->Comments)) $o['Comments'] = $this->Comments;
        if (isset($this->UserName)) $o['UserName'] = $this->UserName;
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        return empty($o) ? new class(){} : $o;
    }
}

class CurrencyInfoResponse implements JsonSerializable
{
    public function __construct(
        /** @description The currency id */
        // @ApiMember(Description="The currency id")
        /** @var string|null */
        public ?string $Id=null,

        /** @description The currency id */
        // @ApiMember(Description="The currency id")
        /** @var string|null */
        public ?string $Name=null,

        /** @description The currency id */
        // @ApiMember(Description="The currency id")
        /** @var string|null */
        public ?string $CurrencySign=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['CurrencySign'])) $this->CurrencySign = $o['CurrencySign'];
    }
    
    /** @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->CurrencySign)) $o['CurrencySign'] = $this->CurrencySign;
        return empty($o) ? new class(){} : $o;
    }
}

class BookingPaymentLogQueryResponse implements JsonSerializable
{
    public function __construct(
        /** @description The booking payment log id */
        // @ApiMember(Description="The booking payment log id")
        /** @var int */
        public int $Id=0,

        /** @description The booking id */
        // @ApiMember(Description="The booking id")
        /** @var int */
        public int $BookingId=0,

        /** @description The payment reference id */
        // @ApiMember(Description="The payment reference id")
        /** @var string|null */
        public ?string $PaymentReferenceId=null,

        /** @description The payment order item reference id */
        // @ApiMember(Description="The payment order item reference id")
        /** @var string|null */
        public ?string $OrderItemReferenceId=null,

        /** @description The payment reference id */
        // @ApiMember(Description="The payment reference id")
        /** @var int|null */
        public ?int $PaymentProviderId=null,

        /** @description The payment amount */
        // @ApiMember(Description="The payment amount")
        /** @var float */
        public float $Amount=0.0,

        /** @description The payment VAT in percent */
        // @ApiMember(Description="The payment VAT in percent")
        /** @var float */
        public float $VAT=0.0,

        /** @description The payment amount that is credited */
        // @ApiMember(Description="The payment amount that is credited")
        /** @var float */
        public float $AmountCredited=0.0,

        /** @description The payment currency id */
        // @ApiMember(Description="The payment currency id")
        /** @var string|null */
        public ?string $CurrencyId=null,

        /** @description The payment currency info */
        // @ApiMember(Description="The payment currency info")
        /** @var CurrencyInfoResponse|null */
        public ?CurrencyInfoResponse $CurrencyInfo=null,

        /** @description Comments that could be added to the event log item */
        // @ApiMember(Description="Comments that could be added to the event log item")
        /** @var string|null */
        public ?string $Comments=null,

        /** @description The date when the payment items was created */
        // @ApiMember(Description="The date when the payment items was created")
        /** @var DateTime */
        public DateTime $Created=new DateTime(),

        /** @description The date when the payment items was update */
        // @ApiMember(Description="The date when the payment items was update")
        /** @var DateTime */
        public DateTime $Updated=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['BookingId'])) $this->BookingId = $o['BookingId'];
        if (isset($o['PaymentReferenceId'])) $this->PaymentReferenceId = $o['PaymentReferenceId'];
        if (isset($o['OrderItemReferenceId'])) $this->OrderItemReferenceId = $o['OrderItemReferenceId'];
        if (isset($o['PaymentProviderId'])) $this->PaymentProviderId = $o['PaymentProviderId'];
        if (isset($o['Amount'])) $this->Amount = $o['Amount'];
        if (isset($o['VAT'])) $this->VAT = $o['VAT'];
        if (isset($o['AmountCredited'])) $this->AmountCredited = $o['AmountCredited'];
        if (isset($o['CurrencyId'])) $this->CurrencyId = $o['CurrencyId'];
        if (isset($o['CurrencyInfo'])) $this->CurrencyInfo = JsonConverters::from('CurrencyInfoResponse', $o['CurrencyInfo']);
        if (isset($o['Comments'])) $this->Comments = $o['Comments'];
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['Updated'])) $this->Updated = JsonConverters::from('DateTime', $o['Updated']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->BookingId)) $o['BookingId'] = $this->BookingId;
        if (isset($this->PaymentReferenceId)) $o['PaymentReferenceId'] = $this->PaymentReferenceId;
        if (isset($this->OrderItemReferenceId)) $o['OrderItemReferenceId'] = $this->OrderItemReferenceId;
        if (isset($this->PaymentProviderId)) $o['PaymentProviderId'] = $this->PaymentProviderId;
        if (isset($this->Amount)) $o['Amount'] = $this->Amount;
        if (isset($this->VAT)) $o['VAT'] = $this->VAT;
        if (isset($this->AmountCredited)) $o['AmountCredited'] = $this->AmountCredited;
        if (isset($this->CurrencyId)) $o['CurrencyId'] = $this->CurrencyId;
        if (isset($this->CurrencyInfo)) $o['CurrencyInfo'] = JsonConverters::to('CurrencyInfoResponse', $this->CurrencyInfo);
        if (isset($this->Comments)) $o['Comments'] = $this->Comments;
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->Updated)) $o['Updated'] = JsonConverters::to('DateTime', $this->Updated);
        return empty($o) ? new class(){} : $o;
    }
}

class BookingCheckoutQueryResponse implements JsonSerializable
{
    public function __construct(
        /** @description The checkout id */
        // @ApiMember(Description="The checkout id")
        /** @var string */
        public string $Id='',

        /** @description The booking id */
        // @ApiMember(Description="The booking id")
        /** @var int */
        public int $BookingId=0,

        /** @description The purchase id */
        // @ApiMember(Description="The purchase id")
        /** @var int|null */
        public ?int $PurchaseId=null,

        /** @description The payment checkout expiration datetime */
        // @ApiMember(Description="The payment checkout expiration datetime")
        /** @var DateTime|null */
        public ?DateTime $ExpirationTime=null,

        /** @description The payment snippet code */
        // @ApiMember(Description="The payment snippet code")
        /** @var string|null */
        public ?string $Snippet=null,

        /** @description The payment status */
        // @ApiMember(Description="The payment status")
        /** @var string|null */
        public ?string $Status=null,

        /** @description Log message */
        // @ApiMember(Description="Log message")
        /** @var string|null */
        public ?string $Message=null,

        /** @description When the checkout log item was created */
        // @ApiMember(Description="When the checkout log item was created")
        /** @var DateTime */
        public DateTime $Created=new DateTime(),

        /** @description When the checkout log item was updated */
        // @ApiMember(Description="When the checkout log item was updated")
        /** @var DateTime */
        public DateTime $Updated=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['BookingId'])) $this->BookingId = $o['BookingId'];
        if (isset($o['PurchaseId'])) $this->PurchaseId = $o['PurchaseId'];
        if (isset($o['ExpirationTime'])) $this->ExpirationTime = JsonConverters::from('DateTime', $o['ExpirationTime']);
        if (isset($o['Snippet'])) $this->Snippet = $o['Snippet'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['Message'])) $this->Message = $o['Message'];
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['Updated'])) $this->Updated = JsonConverters::from('DateTime', $o['Updated']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->BookingId)) $o['BookingId'] = $this->BookingId;
        if (isset($this->PurchaseId)) $o['PurchaseId'] = $this->PurchaseId;
        if (isset($this->ExpirationTime)) $o['ExpirationTime'] = JsonConverters::to('DateTime', $this->ExpirationTime);
        if (isset($this->Snippet)) $o['Snippet'] = $this->Snippet;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->Message)) $o['Message'] = $this->Message;
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->Updated)) $o['Updated'] = JsonConverters::to('DateTime', $this->Updated);
        return empty($o) ? new class(){} : $o;
    }
}

class ExternalReferenceResponse implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $CompanyId='',
        /** @var string */
        public string $Id='',
        /** @var string */
        public string $OwnerId='',
        /** @var string|null */
        public ?string $ReferenceType=null,
        /** @var string|null */
        public ?string $ExternalData=null,
        /** @var string|null */
        public ?string $CreatedBy=null,
        /** @var DateTime */
        public DateTime $Updated=new DateTime(),
        /** @var DateTime */
        public DateTime $Created=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['OwnerId'])) $this->OwnerId = $o['OwnerId'];
        if (isset($o['ReferenceType'])) $this->ReferenceType = $o['ReferenceType'];
        if (isset($o['ExternalData'])) $this->ExternalData = $o['ExternalData'];
        if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
        if (isset($o['Updated'])) $this->Updated = JsonConverters::from('DateTime', $o['Updated']);
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->OwnerId)) $o['OwnerId'] = $this->OwnerId;
        if (isset($this->ReferenceType)) $o['ReferenceType'] = $this->ReferenceType;
        if (isset($this->ExternalData)) $o['ExternalData'] = $this->ExternalData;
        if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
        if (isset($this->Updated)) $o['Updated'] = JsonConverters::to('DateTime', $this->Updated);
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        return empty($o) ? new class(){} : $o;
    }
}

class BookingCalendarExportStatus implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $CalendarId=null,
        /** @var int */
        public int $BookingId=0,
        /** @var bool|null */
        public ?bool $Synced=null
    ) {
    }

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

class BookingQueryResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string */
        public string $CompanyId='',
        /** @var DateTime */
        public DateTime $From=new DateTime(),
        /** @var DateTime */
        public DateTime $To=new DateTime(),
        /** @var BookingStatusEnum|null */
        public ?BookingStatusEnum $Status=null,
        /** @var int */
        public int $StatusId=0,
        /** @var string|null */
        public ?string $StatusName=null,
        /** @var BookingStatusQueryResponse|null */
        public ?BookingStatusQueryResponse $StatusInfo=null,
        /** @var bool|null */
        public ?bool $SendEmailReminder=null,
        /** @var bool|null */
        public ?bool $SendSmsReminder=null,
        /** @var bool|null */
        public ?bool $SendSmsConfirmation=null,
        /** @var bool|null */
        public ?bool $SendEmailConfirmation=null,
        /** @var DateTime|null */
        public ?DateTime $LastTimeToUnBook=null,
        /** @var array<CustomFieldConfigData>|null */
        public ?array $CustomFields=null,
        /** @var array<CustomFieldDataResponse>|null */
        public ?array $CustomFieldValues=null,
        /** @var array<BookedResourceType>|null */
        public ?array $BookedResourceTypes=null,
        /** @var BookedCompany|null */
        public ?BookedCompany $Company=null,
        /** @var BookedCustomer|null */
        public ?BookedCustomer $Customer=null,
        /** @var array<BookedQuantity>|null */
        public ?array $Quantities=null,
        /** @var ServiceInfoResponse|null */
        public ?ServiceInfoResponse $Service=null,
        /** @var DateTime|null */
        public ?DateTime $PaymentExpiration=null,
        /** @var array<BookingLogQueryResponse>|null */
        public ?array $Log=null,
        /** @var array<BookingPaymentLogQueryResponse>|null */
        public ?array $PaymentLog=null,
        /** @var array<BookingCheckoutQueryResponse>|null */
        public ?array $CheckoutLog=null,
        /** @var array<ExternalReferenceResponse>|null */
        public ?array $ExternalReference=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var BookingCalendarExportStatus|null */
        public ?BookingCalendarExportStatus $CalendarExportStatus=null,
        /** @var int|null */
        public ?int $LengthInMinutes=null,
        /** @var string|null */
        public ?string $BookedBy=null,
        /** @var string|null */
        public ?string $BookedComments=null,
        /** @var string|null */
        public ?string $UnbookedComments=null,
        /** @var string|null */
        public ?string $CommentsToCustomer=null,
        /** @var DateTime */
        public DateTime $CreatedDate=new DateTime(),
        /** @var DateTime */
        public DateTime $UpdatedDate=new DateTime(),
        /** @var DateTime|null */
        public ?DateTime $UnbookedOn=null,
        /** @var string|null */
        public ?string $CancellationCode=null,
        /** @var string|null */
        public ?string $RatingCode=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['From'])) $this->From = JsonConverters::from('DateTime', $o['From']);
        if (isset($o['To'])) $this->To = JsonConverters::from('DateTime', $o['To']);
        if (isset($o['Status'])) $this->Status = JsonConverters::from('BookingStatusEnum', $o['Status']);
        if (isset($o['StatusId'])) $this->StatusId = $o['StatusId'];
        if (isset($o['StatusName'])) $this->StatusName = $o['StatusName'];
        if (isset($o['StatusInfo'])) $this->StatusInfo = JsonConverters::from('BookingStatusQueryResponse', $o['StatusInfo']);
        if (isset($o['SendEmailReminder'])) $this->SendEmailReminder = $o['SendEmailReminder'];
        if (isset($o['SendSmsReminder'])) $this->SendSmsReminder = $o['SendSmsReminder'];
        if (isset($o['SendSmsConfirmation'])) $this->SendSmsConfirmation = $o['SendSmsConfirmation'];
        if (isset($o['SendEmailConfirmation'])) $this->SendEmailConfirmation = $o['SendEmailConfirmation'];
        if (isset($o['LastTimeToUnBook'])) $this->LastTimeToUnBook = JsonConverters::from('DateTime', $o['LastTimeToUnBook']);
        if (isset($o['CustomFields'])) $this->CustomFields = JsonConverters::fromArray('CustomFieldConfigData', $o['CustomFields']);
        if (isset($o['CustomFieldValues'])) $this->CustomFieldValues = JsonConverters::fromArray('CustomFieldDataResponse', $o['CustomFieldValues']);
        if (isset($o['BookedResourceTypes'])) $this->BookedResourceTypes = JsonConverters::fromArray('BookedResourceType', $o['BookedResourceTypes']);
        if (isset($o['Company'])) $this->Company = JsonConverters::from('BookedCompany', $o['Company']);
        if (isset($o['Customer'])) $this->Customer = JsonConverters::from('BookedCustomer', $o['Customer']);
        if (isset($o['Quantities'])) $this->Quantities = JsonConverters::fromArray('BookedQuantity', $o['Quantities']);
        if (isset($o['Service'])) $this->Service = JsonConverters::from('ServiceInfoResponse', $o['Service']);
        if (isset($o['PaymentExpiration'])) $this->PaymentExpiration = JsonConverters::from('DateTime', $o['PaymentExpiration']);
        if (isset($o['Log'])) $this->Log = JsonConverters::fromArray('BookingLogQueryResponse', $o['Log']);
        if (isset($o['PaymentLog'])) $this->PaymentLog = JsonConverters::fromArray('BookingPaymentLogQueryResponse', $o['PaymentLog']);
        if (isset($o['CheckoutLog'])) $this->CheckoutLog = JsonConverters::fromArray('BookingCheckoutQueryResponse', $o['CheckoutLog']);
        if (isset($o['ExternalReference'])) $this->ExternalReference = JsonConverters::fromArray('ExternalReferenceResponse', $o['ExternalReference']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['CalendarExportStatus'])) $this->CalendarExportStatus = JsonConverters::from('BookingCalendarExportStatus', $o['CalendarExportStatus']);
        if (isset($o['LengthInMinutes'])) $this->LengthInMinutes = $o['LengthInMinutes'];
        if (isset($o['BookedBy'])) $this->BookedBy = $o['BookedBy'];
        if (isset($o['BookedComments'])) $this->BookedComments = $o['BookedComments'];
        if (isset($o['UnbookedComments'])) $this->UnbookedComments = $o['UnbookedComments'];
        if (isset($o['CommentsToCustomer'])) $this->CommentsToCustomer = $o['CommentsToCustomer'];
        if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
        if (isset($o['UpdatedDate'])) $this->UpdatedDate = JsonConverters::from('DateTime', $o['UpdatedDate']);
        if (isset($o['UnbookedOn'])) $this->UnbookedOn = JsonConverters::from('DateTime', $o['UnbookedOn']);
        if (isset($o['CancellationCode'])) $this->CancellationCode = $o['CancellationCode'];
        if (isset($o['RatingCode'])) $this->RatingCode = $o['RatingCode'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->From)) $o['From'] = JsonConverters::to('DateTime', $this->From);
        if (isset($this->To)) $o['To'] = JsonConverters::to('DateTime', $this->To);
        if (isset($this->Status)) $o['Status'] = JsonConverters::to('BookingStatusEnum', $this->Status);
        if (isset($this->StatusId)) $o['StatusId'] = $this->StatusId;
        if (isset($this->StatusName)) $o['StatusName'] = $this->StatusName;
        if (isset($this->StatusInfo)) $o['StatusInfo'] = JsonConverters::to('BookingStatusQueryResponse', $this->StatusInfo);
        if (isset($this->SendEmailReminder)) $o['SendEmailReminder'] = $this->SendEmailReminder;
        if (isset($this->SendSmsReminder)) $o['SendSmsReminder'] = $this->SendSmsReminder;
        if (isset($this->SendSmsConfirmation)) $o['SendSmsConfirmation'] = $this->SendSmsConfirmation;
        if (isset($this->SendEmailConfirmation)) $o['SendEmailConfirmation'] = $this->SendEmailConfirmation;
        if (isset($this->LastTimeToUnBook)) $o['LastTimeToUnBook'] = JsonConverters::to('DateTime', $this->LastTimeToUnBook);
        if (isset($this->CustomFields)) $o['CustomFields'] = JsonConverters::toArray('CustomFieldConfigData', $this->CustomFields);
        if (isset($this->CustomFieldValues)) $o['CustomFieldValues'] = JsonConverters::toArray('CustomFieldDataResponse', $this->CustomFieldValues);
        if (isset($this->BookedResourceTypes)) $o['BookedResourceTypes'] = JsonConverters::toArray('BookedResourceType', $this->BookedResourceTypes);
        if (isset($this->Company)) $o['Company'] = JsonConverters::to('BookedCompany', $this->Company);
        if (isset($this->Customer)) $o['Customer'] = JsonConverters::to('BookedCustomer', $this->Customer);
        if (isset($this->Quantities)) $o['Quantities'] = JsonConverters::toArray('BookedQuantity', $this->Quantities);
        if (isset($this->Service)) $o['Service'] = JsonConverters::to('ServiceInfoResponse', $this->Service);
        if (isset($this->PaymentExpiration)) $o['PaymentExpiration'] = JsonConverters::to('DateTime', $this->PaymentExpiration);
        if (isset($this->Log)) $o['Log'] = JsonConverters::toArray('BookingLogQueryResponse', $this->Log);
        if (isset($this->PaymentLog)) $o['PaymentLog'] = JsonConverters::toArray('BookingPaymentLogQueryResponse', $this->PaymentLog);
        if (isset($this->CheckoutLog)) $o['CheckoutLog'] = JsonConverters::toArray('BookingCheckoutQueryResponse', $this->CheckoutLog);
        if (isset($this->ExternalReference)) $o['ExternalReference'] = JsonConverters::toArray('ExternalReferenceResponse', $this->ExternalReference);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->CalendarExportStatus)) $o['CalendarExportStatus'] = JsonConverters::to('BookingCalendarExportStatus', $this->CalendarExportStatus);
        if (isset($this->LengthInMinutes)) $o['LengthInMinutes'] = $this->LengthInMinutes;
        if (isset($this->BookedBy)) $o['BookedBy'] = $this->BookedBy;
        if (isset($this->BookedComments)) $o['BookedComments'] = $this->BookedComments;
        if (isset($this->UnbookedComments)) $o['UnbookedComments'] = $this->UnbookedComments;
        if (isset($this->CommentsToCustomer)) $o['CommentsToCustomer'] = $this->CommentsToCustomer;
        if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
        if (isset($this->UpdatedDate)) $o['UpdatedDate'] = JsonConverters::to('DateTime', $this->UpdatedDate);
        if (isset($this->UnbookedOn)) $o['UnbookedOn'] = JsonConverters::to('DateTime', $this->UnbookedOn);
        if (isset($this->CancellationCode)) $o['CancellationCode'] = $this->CancellationCode;
        if (isset($this->RatingCode)) $o['RatingCode'] = $this->RatingCode;
        return empty($o) ? new class(){} : $o;
    }
}

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class CreateBooking extends CreateBookingBase implements IInterval, JsonSerializable
{
    /**
     * @param string|null $CompanyId
     * @param string|null $CustomerId
     * @param string|null $PinCode
     * @param CustomerToBook|null $Customer
     * @param int $ServiceId
     * @param string|null $BookedComments
     * @param string|null $CommentsToCustomer
     * @param array<ResourceToBook>|null $Resources
     * @param array<int>|null $RebateCodeIds
     * @param bool|null $SendEmailReminder
     * @param bool|null $SendSmsReminder
     * @param bool|null $SendSmsConfirmation
     * @param bool|null $SendEmailConfirmation
     * @param PaymentOptions|null $PaymentOption
     * @param array<AddCustomField>|null $CustomFields
     * @param array<AddCustomField>|null $CustomerCustomFields
     * @param bool|null $AllowBookingOutsideSchedules
     */
    public function __construct(
        ?string $CompanyId=null,
        ?string $CustomerId=null,
        ?string $PinCode=null,
        ?CustomerToBook $Customer=null,
        int $ServiceId=0,
        ?string $BookedComments=null,
        ?string $CommentsToCustomer=null,
        ?array $Resources=null,
        ?array $RebateCodeIds=null,
        ?bool $SendEmailReminder=null,
        ?bool $SendSmsReminder=null,
        ?bool $SendSmsConfirmation=null,
        ?bool $SendEmailConfirmation=null,
        ?PaymentOptions $PaymentOption=null,
        ?array $CustomFields=null,
        ?array $CustomerCustomFields=null,
        ?bool $AllowBookingOutsideSchedules=null,
        /** @description The datetime you want to start the booking. */
        // @ApiMember(Description="The datetime you want to start the booking.", IsRequired=true)
        /** @var DateTime */
        public DateTime $From=new DateTime(),

        /** @description The datetime you want to end the booking. */
        // @ApiMember(Description="The datetime you want to end the booking.", IsRequired=true)
        /** @var DateTime */
        public DateTime $To=new DateTime(),

        /** @description Set the number of spots you want to book. You add number of spots per price category. Multiple spots require that the service has GroupBooking enabled. Default is one spot. */
        // @ApiMember(Description="Set the number of spots you want to book. You add number of spots per price category. Multiple spots require that the service has GroupBooking enabled. Default is one spot.")
        /** @var QuantityToBook[]|null */
        public ?array $Quantities=null
    ) {
        parent::__construct($CompanyId,$CustomerId,$PinCode,$Customer,$ServiceId,$BookedComments,$CommentsToCustomer,$Resources,$RebateCodeIds,$SendEmailReminder,$SendSmsReminder,$SendSmsConfirmation,$SendEmailConfirmation,$PaymentOption,$CustomFields,$CustomerCustomFields,$AllowBookingOutsideSchedules);
    }

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

class QuantityToBook implements JsonSerializable
{
    public function __construct(
        /** @description If service has a price, enter the price id for that price. If no price exists for the service set 0 as PriceId. If you put 0 and a price exists, it will use that price (only works if just one price exists for the current selected date to book) */
        // @ApiMember(Description="If service has a price, enter the price id for that price. If no price exists for the service set 0 as PriceId. If you put 0 and a price exists, it will use that price (only works if just one price exists for the current selected date to book)", IsRequired=true)
        /** @var int */
        public int $PriceId=0,

        /** @description Set the number of spots or resources you want to book on the specific price category */
        // @ApiMember(Description="Set the number of spots or resources you want to book on the specific price category", IsRequired=true)
        /** @var int */
        public int $Quantity=0,

        /** @description If the quantity you add should occupy a spot. Default is true. If no it will only be a row that includes price information. */
        // @ApiMember(Description="If the quantity you add should occupy a spot. Default is true. If no it will only be a row that includes price information.")
        /** @var bool|null */
        public ?bool $OccupiesSpot=null
    ) {
    }

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

PHP CreateBooking DTOs

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

HTTP + JSV

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

POST /bookings HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Quantities: 
	[
		{
			PriceId: 0,
			Quantity: 0,
			OccupiesSpot: False
		}
	],
	CompanyId: 00000000-0000-0000-0000-000000000000,
	CustomerId: 00000000-0000-0000-0000-000000000000,
	PinCode: String,
	Customer: 
	{
		Firstname: String,
		Lastname: String,
		Email: String,
		Phone: String
	},
	ServiceId: 0,
	BookedComments: String,
	CommentsToCustomer: String,
	Resources: 
	[
		{
			ResourceTypeId: 0,
			ResourceId: 0
		}
	],
	RebateCodeIds: 
	[
		0
	],
	SendEmailReminder: False,
	SendSmsReminder: False,
	SendSmsConfirmation: False,
	SendEmailConfirmation: False,
	PaymentOption: DefaultSetting,
	CustomFields: 
	[
		{
			Id: 0,
			Value: String
		}
	],
	CustomerCustomFields: 
	[
		{
			Id: 0,
			Value: String
		}
	],
	AllowBookingOutsideSchedules: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Id: 0,
	Status: Booked,
	StatusId: 0,
	StatusName: String,
	StatusInfo: 
	{
		Id: 0,
		Name: String,
		Description: String,
		Icon: String,
		Color: String
	},
	SendEmailReminder: False,
	SendSmsReminder: False,
	SendSmsConfirmation: False,
	SendEmailConfirmation: False,
	LastTimeToUnBook: "0001-01-01T00:00:00",
	CustomFields: 
	[
		{
			"Id": 0,
			"Name": "String",
			"Description": "String",
			"Width": 0,
			"DataType": "String",
			"DefaultValue": "String",
			"IsMandatory": false,
			"MandatoryErrorMessage": "String",
			"MaxLength": 0,
			"MultipleLineText": false,
			"RegEx": "String",
			"RegExErrorMessage": "String",
			"Values": 
			[
				{
					"Value": "String"
				}
			]
		}
	],
	CustomFieldValues: 
	[
		{
			Id: 0,
			Column: String,
			Name: String,
			Description: String,
			Value: String,
			DataType: String
		}
	],
	BookedResourceTypes: 
	[
		{
			Id: 0,
			Name: String,
			Resources: 
			[
				{
					Id: 0,
					Name: String,
					Color: String,
					Email: String,
					MobilePhone: String,
					AccessGroup: String,
					EmailNotification: False,
					SMSNotification: False,
					EmailReminder: False,
					SMSReminder: False
				}
			]
		}
	],
	Company: 
	{
		Name: String,
		Category: String,
		Street1: String,
		Street2: String,
		ZipCode: String,
		City: String,
		CountryId: String,
		Longitude: String,
		Latitude: String,
		Phone: String,
		Email: String,
		HomePage: String,
		SitePath: String,
		IsFavorite: False,
		PaymentProviderId: 0
	},
	Customer: 
	{
		Firstname: String,
		Lastname: String,
		Email: String,
		Phone: String,
		FacebookUserName: String,
		ImageUrl: String,
		CorporateIdentityNumber: String,
		InvoiceAddress1: String,
		InvoiceAddress2: String,
		InvoiceCity: String,
		InvoicePostalCode: String,
		InvoiceCountryCode: String
	},
	Quantities: 
	[
		{
			Id: 0,
			Quantity: 0,
			Price: 0,
			PriceBeforeRebate: 0,
			CurrencyId: String,
			PriceSign: String,
			Category: String,
			VAT: 0,
			PriceText: String,
			OccupiesSpot: False
		}
	],
	Service: 
	{
		Id: 0,
		Name: String,
		Description: String,
		LengthInMinutes: 0,
		MaxNumberOfSpotsPerBooking: 0,
		GroupBooking: 
		{
			Active: False,
			Min: 0,
			Max: 0
		},
		MultipleResource: 
		{
			Active: False,
			Min: 0,
			Max: 0
		},
		IsGroupBooking: False,
		IsPaymentEnabled: False
	},
	PaymentExpiration: "0001-01-01T00:00:00",
	Log: 
	[
		{
			Id: 0,
			BookingId: 0,
			EventTypeId: 0,
			EventType: 
			{
				Id: 0,
				Name: String,
				Description: String
			},
			Comments: String,
			UserName: String
		}
	],
	PaymentLog: 
	[
		{
			Id: 0,
			BookingId: 0,
			PaymentReferenceId: String,
			OrderItemReferenceId: String,
			PaymentProviderId: 0,
			Amount: 0,
			VAT: 0,
			AmountCredited: 0,
			CurrencyId: String,
			CurrencyInfo: 
			{
				Id: String,
				Name: String,
				CurrencySign: String
			},
			Comments: String
		}
	],
	CheckoutLog: 
	[
		{
			BookingId: 0,
			PurchaseId: 0,
			ExpirationTime: "0001-01-01T00:00:00",
			Snippet: String,
			Status: String,
			Message: String
		}
	],
	ExternalReference: 
	[
		{
			ReferenceType: String,
			ExternalData: String,
			CreatedBy: String
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	CalendarExportStatus: 
	{
		CalendarId: String,
		BookingId: 0,
		Synced: False
	},
	LengthInMinutes: 0,
	BookedBy: String,
	BookedComments: String,
	UnbookedComments: String,
	CommentsToCustomer: String,
	UnbookedOn: "0001-01-01T00:00:00",
	CancellationCode: String,
	RatingCode: String
}