BokaMera.API.Host

<back to all web services

AddResourceToBooking

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/bookings/{Id}/resourceAdd a resource to a bookingUpdates an existing booking with a new resource tharet must be avaialable (not booked or occupied).
<?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};


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 int */
        public int $MinNumberOfSpotsPerBooking=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['MinNumberOfSpotsPerBooking'])) $this->MinNumberOfSpotsPerBooking = $o['MinNumberOfSpotsPerBooking'];
        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->MinNumberOfSpotsPerBooking)) $o['MinNumberOfSpotsPerBooking'] = $this->MinNumberOfSpotsPerBooking;
        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)
// @ApiResponse(Description="You have too low privilegies to call this service", StatusCode=403)
// @ValidateRequest(Validator="IsAuthenticated")
class AddResourceToBooking implements ICompany, 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 Id of the booking */
        // @ApiMember(Description="Id of the booking", IsRequired=true, ParameterType="path")
        /** @var int */
        public int $Id=0,

        /** @description The resource type id */
        // @ApiMember(Description="The resource type id")
        /** @var int */
        public int $ResourceTypeId=0,

        /** @description The resource id */
        // @ApiMember(Description="The resource id")
        /** @var int */
        public int $ResourceId=0
    ) {
    }

    /** @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['ResourceTypeId'])) $this->ResourceTypeId = $o['ResourceTypeId'];
        if (isset($o['ResourceId'])) $this->ResourceId = $o['ResourceId'];
    }
    
    /** @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->ResourceTypeId)) $o['ResourceTypeId'] = $this->ResourceTypeId;
        if (isset($this->ResourceId)) $o['ResourceId'] = $this->ResourceId;
        return empty($o) ? new class(){} : $o;
    }
}

PHP AddResourceToBooking DTOs

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

HTTP + XML

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

POST /bookings/{Id}/resource HTTP/1.1 
Host: api.bokamera.se 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<AddResourceToBooking xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <Id>0</Id>
  <ResourceId>0</ResourceId>
  <ResourceTypeId>0</ResourceTypeId>
</AddResourceToBooking>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<BookingQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <BookedBy>String</BookedBy>
  <BookedComments>String</BookedComments>
  <BookedResourceTypes>
    <BookedResourceType>
      <Id>0</Id>
      <Name>String</Name>
      <Resources>
        <BookedResource>
          <AccessGroup>String</AccessGroup>
          <Color>String</Color>
          <Email>String</Email>
          <EmailNotification>false</EmailNotification>
          <EmailReminder>false</EmailReminder>
          <Id>0</Id>
          <ImageUrl i:nil="true" />
          <MobilePhone>String</MobilePhone>
          <Name>String</Name>
          <SMSNotification>false</SMSNotification>
          <SMSReminder>false</SMSReminder>
        </BookedResource>
      </Resources>
    </BookedResourceType>
  </BookedResourceTypes>
  <CalendarExportStatus>
    <BookingId>0</BookingId>
    <CalendarId>String</CalendarId>
    <Synced>false</Synced>
  </CalendarExportStatus>
  <CancellationCode>String</CancellationCode>
  <CheckoutLog>
    <BookingCheckoutQueryResponse>
      <BookingId>0</BookingId>
      <Created>0001-01-01T00:00:00</Created>
      <ExpirationTime>0001-01-01T00:00:00</ExpirationTime>
      <Id>00000000-0000-0000-0000-000000000000</Id>
      <Message>String</Message>
      <PurchaseId>0</PurchaseId>
      <Snippet>String</Snippet>
      <Status>String</Status>
      <Updated>0001-01-01T00:00:00</Updated>
    </BookingCheckoutQueryResponse>
  </CheckoutLog>
  <CommentsToCustomer>String</CommentsToCustomer>
  <Company>
    <Category>String</Category>
    <City>String</City>
    <CountryId>String</CountryId>
    <Email>String</Email>
    <HomePage>String</HomePage>
    <Id>00000000-0000-0000-0000-000000000000</Id>
    <IsFavorite>false</IsFavorite>
    <Latitude>String</Latitude>
    <LogoType i:nil="true" />
    <Longitude>String</Longitude>
    <Name>String</Name>
    <PaymentProviderId>0</PaymentProviderId>
    <Phone>String</Phone>
    <SitePath>String</SitePath>
    <Street1>String</Street1>
    <Street2>String</Street2>
    <ZipCode>String</ZipCode>
  </Company>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <CreatedDate>0001-01-01T00:00:00</CreatedDate>
  <CustomFieldValues>
    <CustomFieldDataResponse>
      <Column>String</Column>
      <DataType>String</DataType>
      <Description>String</Description>
      <Id>0</Id>
      <Name>String</Name>
      <Value>String</Value>
    </CustomFieldDataResponse>
  </CustomFieldValues>
  <CustomFields>
    <CustomFieldConfigData>
      <DataType>String</DataType>
      <DefaultValue>String</DefaultValue>
      <Description>String</Description>
      <Id>0</Id>
      <IsMandatory>false</IsMandatory>
      <MandatoryErrorMessage>String</MandatoryErrorMessage>
      <MaxLength>0</MaxLength>
      <MultipleLineText>false</MultipleLineText>
      <Name>String</Name>
      <RegEx>String</RegEx>
      <RegExErrorMessage>String</RegExErrorMessage>
      <Values>
        <CustomFieldValueResponse>
          <Value>String</Value>
        </CustomFieldValueResponse>
      </Values>
      <Width>0</Width>
    </CustomFieldConfigData>
  </CustomFields>
  <Customer>
    <CorporateIdentityNumber>String</CorporateIdentityNumber>
    <Email>String</Email>
    <FacebookUserName>String</FacebookUserName>
    <Firstname>String</Firstname>
    <Id>00000000-0000-0000-0000-000000000000</Id>
    <ImageUrl>String</ImageUrl>
    <InvoiceAddress1>String</InvoiceAddress1>
    <InvoiceAddress2>String</InvoiceAddress2>
    <InvoiceCity>String</InvoiceCity>
    <InvoiceCountryCode>String</InvoiceCountryCode>
    <InvoicePostalCode>String</InvoicePostalCode>
    <Lastname>String</Lastname>
    <Phone>String</Phone>
  </Customer>
  <ExternalReference>
    <ExternalReferenceResponse>
      <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
      <Created>0001-01-01T00:00:00</Created>
      <CreatedBy>String</CreatedBy>
      <ExternalData>String</ExternalData>
      <Id>00000000-0000-0000-0000-000000000000</Id>
      <OwnerId>00000000-0000-0000-0000-000000000000</OwnerId>
      <ReferenceType>String</ReferenceType>
      <Updated>0001-01-01T00:00:00</Updated>
    </ExternalReferenceResponse>
  </ExternalReference>
  <From>0001-01-01T00:00:00</From>
  <Id>0</Id>
  <LastTimeToUnBook>0001-01-01T00:00:00</LastTimeToUnBook>
  <LengthInMinutes>0</LengthInMinutes>
  <Log>
    <BookingLogQueryResponse>
      <BookingId>0</BookingId>
      <Comments>String</Comments>
      <Created>0001-01-01T00:00:00</Created>
      <EventType>
        <Description>String</Description>
        <Id>0</Id>
        <Name>String</Name>
      </EventType>
      <EventTypeId>0</EventTypeId>
      <Id>0</Id>
      <UserName>String</UserName>
    </BookingLogQueryResponse>
  </Log>
  <PaymentExpiration>0001-01-01T00:00:00</PaymentExpiration>
  <PaymentLog>
    <BookingPaymentLogQueryResponse>
      <Amount>0</Amount>
      <AmountCredited>0</AmountCredited>
      <BookingId>0</BookingId>
      <Comments>String</Comments>
      <Created>0001-01-01T00:00:00</Created>
      <CurrencyId>String</CurrencyId>
      <CurrencyInfo>
        <CurrencySign>String</CurrencySign>
        <Id>String</Id>
        <Name>String</Name>
      </CurrencyInfo>
      <Id>0</Id>
      <OrderItemReferenceId>String</OrderItemReferenceId>
      <PaymentProviderId>0</PaymentProviderId>
      <PaymentReferenceId>String</PaymentReferenceId>
      <Updated>0001-01-01T00:00:00</Updated>
      <VAT>0</VAT>
    </BookingPaymentLogQueryResponse>
  </PaymentLog>
  <Quantities>
    <BookedQuantity>
      <Category>String</Category>
      <CurrencyId>String</CurrencyId>
      <Id>0</Id>
      <OccupiesSpot>false</OccupiesSpot>
      <Price>0</Price>
      <PriceBeforeRebate>0</PriceBeforeRebate>
      <PriceSign>String</PriceSign>
      <PriceText>String</PriceText>
      <Quantity>0</Quantity>
      <VAT>0</VAT>
    </BookedQuantity>
  </Quantities>
  <RatingCode>String</RatingCode>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <SendEmailConfirmation>false</SendEmailConfirmation>
  <SendEmailReminder>false</SendEmailReminder>
  <SendSmsConfirmation>false</SendSmsConfirmation>
  <SendSmsReminder>false</SendSmsReminder>
  <Service>
    <Description>String</Description>
    <GroupBooking>
      <Active>false</Active>
      <Max>0</Max>
      <Min>0</Min>
    </GroupBooking>
    <Id>0</Id>
    <ImageUrl i:nil="true" />
    <IsGroupBooking>false</IsGroupBooking>
    <IsPaymentEnabled>false</IsPaymentEnabled>
    <LengthInMinutes>0</LengthInMinutes>
    <MaxNumberOfSpotsPerBooking>0</MaxNumberOfSpotsPerBooking>
    <MinNumberOfSpotsPerBooking>0</MinNumberOfSpotsPerBooking>
    <MultipleResource>
      <Active>false</Active>
      <Max>0</Max>
      <Min>0</Min>
    </MultipleResource>
    <Name>String</Name>
  </Service>
  <Status>Booked</Status>
  <StatusId>0</StatusId>
  <StatusInfo>
    <Color>String</Color>
    <Description>String</Description>
    <Icon>String</Icon>
    <Id>0</Id>
    <Name>String</Name>
  </StatusInfo>
  <StatusName>String</StatusName>
  <To>0001-01-01T00:00:00</To>
  <UnbookedComments>String</UnbookedComments>
  <UnbookedOn>0001-01-01T00:00:00</UnbookedOn>
  <UpdatedDate>0001-01-01T00:00:00</UpdatedDate>
</BookingQueryResponse>