BokaMera.API.Host

<back to all web services

ResourceTypeQuery

Requires Authentication
The following routes are available for this service:
GET/resourcetypesFind resourcetypes.
<?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};


// @DataContract
class QueryBase implements JsonSerializable
{
    public function __construct(
        /** @description Skip over a given number of elements in a sequence and then return the remainder. Use this when you need paging.<br/><br/><strong>Example:</strong><br/><code>?skip=10&orderBy=Id</code> */
        // @DataMember(Order=1)
        /** @var int|null */
        public ?int $Skip=null,

        /** @description Return a given number of elements in a sequence and then skip over the remainder. Use this when you need paging.<br/><br/><strong>Example:</strong><br/><code>?take=20</code> */
        // @DataMember(Order=2)
        /** @var int|null */
        public ?int $Take=null,

        /** @description Comma separated list of fields to order by. Prefix the field name with a minus if you wan't to invert the sort for that field.<br/><br/><strong>Example:</strong><br/><code>?orderBy=Id,-Age,FirstName</code> */
        // @DataMember(Order=3)
        /** @var string|null */
        public ?string $OrderBy=null,

        /** @description Comma separated list of fields to order by in descending order. Prefix the field name with a minus if you wan't to invert the sort for that field.<br/><br/><strong>Example:</strong><br/><code>?orderByDesc=Id,-Age,FirstName</code> */
        // @DataMember(Order=4)
        /** @var string|null */
        public ?string $OrderByDesc=null,

        /** @description Include any of the aggregates <code>AVG, COUNT, FIRST, LAST, MAX, MIN, SUM</code> in your result set. The results will be returned in the meta field.<br/><br/><strong>Example:</strong><br/><code>?include=COUNT(*) as Total</code><br/><br/>or multiple fields with<br/><code>?include=Count(*) Total, Min(Age), AVG(Age) AverageAge</code><br/></br>or unique with<br/><code>?include=COUNT(DISTINCT LivingStatus) as UniqueStatus</code> */
        // @DataMember(Order=5)
        /** @var string|null */
        public ?string $Include=null,

        // @DataMember(Order=6)
        /** @var string|null */
        public ?string $Fields=null,

        // @DataMember(Order=7)
        /** @var array<string,string>|null */
        public ?array $Meta=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Skip'])) $this->Skip = $o['Skip'];
        if (isset($o['Take'])) $this->Take = $o['Take'];
        if (isset($o['OrderBy'])) $this->OrderBy = $o['OrderBy'];
        if (isset($o['OrderByDesc'])) $this->OrderByDesc = $o['OrderByDesc'];
        if (isset($o['Include'])) $this->Include = $o['Include'];
        if (isset($o['Fields'])) $this->Fields = $o['Fields'];
        if (isset($o['Meta'])) $this->Meta = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Meta']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Skip)) $o['Skip'] = $this->Skip;
        if (isset($this->Take)) $o['Take'] = $this->Take;
        if (isset($this->OrderBy)) $o['OrderBy'] = $this->OrderBy;
        if (isset($this->OrderByDesc)) $o['OrderByDesc'] = $this->OrderByDesc;
        if (isset($this->Include)) $o['Include'] = $this->Include;
        if (isset($this->Fields)) $o['Fields'] = $this->Fields;
        if (isset($this->Meta)) $o['Meta'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Meta);
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template From
 * @template Into
 */
class QueryDb2 extends QueryBase implements JsonSerializable
{
    public array $genericArgs = [];
    public static function create(array $genericArgs=[]): QueryDb2 {
        $to = new QueryDb2();
        $to->genericArgs = $genericArgs;
        return $to;
    }

    /**
     * @param int|null $Skip
     * @param int|null $Take
     * @param string|null $OrderBy
     * @param string|null $OrderByDesc
     * @param string|null $Include
     * @param string|null $Fields
     * @param array<string,string>|null $Meta
     */
    public function __construct(
        mixed $Skip=null,
        mixed $Take=null,
        mixed $OrderBy=null,
        mixed $OrderByDesc=null,
        mixed $Include=null,
        mixed $Fields=null,
        mixed $Meta=null
    ) {
        parent::__construct($Skip,$Take,$OrderBy,$OrderByDesc,$Include,$Fields,$Meta);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        return empty($o) ? new class(){} : $o;
    }
}

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

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

        /** @description The resource status */
        // @ApiMember(Description="The resource status")
        /** @var bool|null */
        public ?bool $Active=null,

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

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

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

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

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

        /** @description The priority of the resource */
        // @ApiMember(Description="The priority of the resource")
        /** @var int */
        public int $Priority=0,

        /** @description If the resource want to receive email notifications */
        // @ApiMember(Description="If the resource want to receive email notifications")
        /** @var bool|null */
        public ?bool $EmailNotification=null,

        /** @description If the resource want to receive sms notifications */
        // @ApiMember(Description="If the resource want to receive sms notifications")
        /** @var bool|null */
        public ?bool $SMSNotification=null,

        /** @description If the resource want to receive email reminders */
        // @ApiMember(Description="If the resource want to receive email reminders")
        /** @var bool|null */
        public ?bool $EmailReminder=null,

        /** @description If the resource want to receive sms reminders */
        // @ApiMember(Description="If the resource want to receive sms reminders")
        /** @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['Active'])) $this->Active = $o['Active'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['Color'])) $this->Color = $o['Color'];
        if (isset($o['ImageUrl'])) $this->ImageUrl = JsonConverters::from('string', $o['ImageUrl']);
        if (isset($o['Priority'])) $this->Priority = $o['Priority'];
        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->Active)) $o['Active'] = $this->Active;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->Color)) $o['Color'] = $this->Color;
        if (isset($this->ImageUrl)) $o['ImageUrl'] = JsonConverters::to('string', $this->ImageUrl);
        if (isset($this->Priority)) $o['Priority'] = $this->Priority;
        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 ResourceTypeQueryResponse implements JsonSerializable
{
    public function __construct(
        /** @description The resourcetype id */
        // @ApiMember(Description="The resourcetype id")
        /** @var int */
        public int $Id=0,

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

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

        /** @description The resources in the resourcetype. Only shows active resources if not admin. */
        // @ApiMember(Description="The resources in the resourcetype. Only shows active resources if not admin.")
        /** @var array<ResourceTypeResource>|null */
        public ?array $Resources=null,

        /** @description If resourcetype is active or not */
        // @ApiMember(Description="If resourcetype is active or not")
        /** @var bool|null */
        public ?bool $Active=null,

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

        /** @description Then date when the resource was updated */
        // @ApiMember(Description="Then date when the resource 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['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Resources'])) $this->Resources = JsonConverters::fromArray('ResourceTypeResource', $o['Resources']);
        if (isset($o['Active'])) $this->Active = $o['Active'];
        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->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Resources)) $o['Resources'] = JsonConverters::toArray('ResourceTypeResource', $this->Resources);
        if (isset($this->Active)) $o['Active'] = $this->Active;
        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 BaseModel implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

enum ScheduleType : string
{
    case NotDefined = 'NotDefined';
    case RecurringSchedule = 'RecurringSchedule';
    case DateSchedule = 'DateSchedule';
}

/**
 * @property array<Resource>|null $Resources
 * @property ScheduleType $Type
 * @property bool $Active
 * @property bool $IsResourceSpecific
 */
interface ISchedule
{
}

/**
 * @property int $Id
 * @property string|null $ReasonText
 * @property bool $IsBlock
 * @property string|null $ReasonTextPublic
 * @property bool $IsRecurring
 * @property int[]|null $ResourceIds
 */
interface ITimeException extends IInterval
{
}

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 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;
    }
}

/**
 * @property int $Id
 * @property int $ServiceId
 * @property int $BookedSpots
 * @property int $TotalSpots
 * @property int $PauseAfterInMinutes
 * @property BookingStatusEnum $Status
 * @property int $StatusId
 * @property BookedCustomer|null $Customer
 */
interface IBookedTime extends IInterval
{
}

class CustomFieldValue extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $CompanyId='',

        /** @var int */
        public int $Id=0,
        // @Required()
        /** @var string */
        public string $Value='',

        // @Required()
        /** @var bool|null */
        public ?bool $Active=null,

        /** @var int|null */
        public ?int $SortOrder=null,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Value'])) $this->Value = $o['Value'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['SortOrder'])) $this->SortOrder = $o['SortOrder'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Value)) $o['Value'] = $this->Value;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->SortOrder)) $o['SortOrder'] = $this->SortOrder;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        return empty($o) ? new class(){} : $o;
    }
}

class CustomField extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Table='',

        // @Required()
        /** @var string */
        public string $Column='',

        // @Required()
        /** @var string */
        public string $DataType='',

        // @Required()
        /** @var string */
        public string $Description='',

        // @Required()
        /** @var bool|null */
        public ?bool $Active=null,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Table'])) $this->Table = $o['Table'];
        if (isset($o['Column'])) $this->Column = $o['Column'];
        if (isset($o['DataType'])) $this->DataType = $o['DataType'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Table)) $o['Table'] = $this->Table;
        if (isset($this->Column)) $o['Column'] = $this->Column;
        if (isset($this->DataType)) $o['DataType'] = $this->DataType;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class RegEx extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Description='',

        // @Required()
        /** @var string */
        public string $RegExCode='',

        /** @var string|null */
        public ?string $ErrorMessage=null,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['RegExCode'])) $this->RegExCode = $o['RegExCode'];
        if (isset($o['ErrorMessage'])) $this->ErrorMessage = $o['ErrorMessage'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->RegExCode)) $o['RegExCode'] = $this->RegExCode;
        if (isset($this->ErrorMessage)) $o['ErrorMessage'] = $this->ErrorMessage;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class RebateCodeType extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        /** @var string|null */
        public ?string $Description=null,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class AppliedRebateCodes implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $RebateCodeId=0,
        /** @var string|null */
        public ?string $RebateCodeSign=null,
        /** @var int */
        public int $RebateCodeValue=0,
        /** @var float */
        public float $RebateAmount=0.0,
        /** @var RebateCodeType|null */
        public ?RebateCodeType $RebateCodeType=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['RebateCodeId'])) $this->RebateCodeId = $o['RebateCodeId'];
        if (isset($o['RebateCodeSign'])) $this->RebateCodeSign = $o['RebateCodeSign'];
        if (isset($o['RebateCodeValue'])) $this->RebateCodeValue = $o['RebateCodeValue'];
        if (isset($o['RebateAmount'])) $this->RebateAmount = $o['RebateAmount'];
        if (isset($o['RebateCodeType'])) $this->RebateCodeType = JsonConverters::from('RebateCodeType', $o['RebateCodeType']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->RebateCodeId)) $o['RebateCodeId'] = $this->RebateCodeId;
        if (isset($this->RebateCodeSign)) $o['RebateCodeSign'] = $this->RebateCodeSign;
        if (isset($this->RebateCodeValue)) $o['RebateCodeValue'] = $this->RebateCodeValue;
        if (isset($this->RebateAmount)) $o['RebateAmount'] = $this->RebateAmount;
        if (isset($this->RebateCodeType)) $o['RebateCodeType'] = JsonConverters::to('RebateCodeType', $this->RebateCodeType);
        return empty($o) ? new class(){} : $o;
    }
}

class TotalPriceInformation implements JsonSerializable
{
    public function __construct(
        /** @var float */
        public float $TotalPrice=0.0,
        /** @var float */
        public float $TotalVATAmount=0.0,
        /** @var float */
        public float $TotalRebate=0.0,
        /** @var float */
        public float $TotalPriceBeforeRebate=0.0,
        /** @var array<AppliedRebateCodes>|null */
        public ?array $AppliedCodes=null,
        /** @var string|null */
        public ?string $PriceSign=null,
        /** @var string|null */
        public ?string $CurrencyId=null,
        /** @var float */
        public float $VAT=0.0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['TotalPrice'])) $this->TotalPrice = $o['TotalPrice'];
        if (isset($o['TotalVATAmount'])) $this->TotalVATAmount = $o['TotalVATAmount'];
        if (isset($o['TotalRebate'])) $this->TotalRebate = $o['TotalRebate'];
        if (isset($o['TotalPriceBeforeRebate'])) $this->TotalPriceBeforeRebate = $o['TotalPriceBeforeRebate'];
        if (isset($o['AppliedCodes'])) $this->AppliedCodes = JsonConverters::fromArray('AppliedRebateCodes', $o['AppliedCodes']);
        if (isset($o['PriceSign'])) $this->PriceSign = $o['PriceSign'];
        if (isset($o['CurrencyId'])) $this->CurrencyId = $o['CurrencyId'];
        if (isset($o['VAT'])) $this->VAT = $o['VAT'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->TotalPrice)) $o['TotalPrice'] = $this->TotalPrice;
        if (isset($this->TotalVATAmount)) $o['TotalVATAmount'] = $this->TotalVATAmount;
        if (isset($this->TotalRebate)) $o['TotalRebate'] = $this->TotalRebate;
        if (isset($this->TotalPriceBeforeRebate)) $o['TotalPriceBeforeRebate'] = $this->TotalPriceBeforeRebate;
        if (isset($this->AppliedCodes)) $o['AppliedCodes'] = JsonConverters::toArray('AppliedRebateCodes', $this->AppliedCodes);
        if (isset($this->PriceSign)) $o['PriceSign'] = $this->PriceSign;
        if (isset($this->CurrencyId)) $o['CurrencyId'] = $this->CurrencyId;
        if (isset($this->VAT)) $o['VAT'] = $this->VAT;
        return empty($o) ? new class(){} : $o;
    }
}

enum Currency : int
{
    case SEK = 1;
    case EUR = 2;
}

class PriceMapping extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $CompanyId='',

        // @Required()
        /** @var string */
        public string $Id='',

        // @Required()
        /** @var int */
        public int $PriceId=0,

        /** @var string|null */
        public ?string $ReferenceType=null,
        /** @var string|null */
        public ?string $ExternalReference=null,
        // @Required()
        /** @var DateTime */
        public DateTime $UpdatedDate=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $CreatedDate=new DateTime(),

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['PriceId'])) $this->PriceId = $o['PriceId'];
        if (isset($o['ReferenceType'])) $this->ReferenceType = $o['ReferenceType'];
        if (isset($o['ExternalReference'])) $this->ExternalReference = $o['ExternalReference'];
        if (isset($o['UpdatedDate'])) $this->UpdatedDate = JsonConverters::from('DateTime', $o['UpdatedDate']);
        if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->PriceId)) $o['PriceId'] = $this->PriceId;
        if (isset($this->ReferenceType)) $o['ReferenceType'] = $this->ReferenceType;
        if (isset($this->ExternalReference)) $o['ExternalReference'] = $this->ExternalReference;
        if (isset($this->UpdatedDate)) $o['UpdatedDate'] = JsonConverters::to('DateTime', $this->UpdatedDate);
        if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        return empty($o) ? new class(){} : $o;
    }
}

enum BokaMeraDayOfWeek : int
{
    case Monday = 1;
    case Tuesday = 2;
    case Wednesday = 3;
    case Thursday = 4;
    case Friday = 5;
    case Saturday = 6;
    case Sunday = 7;
}

class ServicePriceDayOfWeekRelation extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var BokaMeraDayOfWeek|null */
        public ?BokaMeraDayOfWeek $DayOfWeek=null,

        // @Required()
        /** @var string */
        public string $CompanyId='',

        // @Required()
        /** @var int */
        public int $ServicePriceId=0,

        // @Required()
        /** @var int */
        public int $DayOfWeekId=0,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['DayOfWeek'])) $this->DayOfWeek = JsonConverters::from('BokaMeraDayOfWeek', $o['DayOfWeek']);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['ServicePriceId'])) $this->ServicePriceId = $o['ServicePriceId'];
        if (isset($o['DayOfWeekId'])) $this->DayOfWeekId = $o['DayOfWeekId'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->DayOfWeek)) $o['DayOfWeek'] = JsonConverters::to('BokaMeraDayOfWeek', $this->DayOfWeek);
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->ServicePriceId)) $o['ServicePriceId'] = $this->ServicePriceId;
        if (isset($this->DayOfWeekId)) $o['DayOfWeekId'] = $this->DayOfWeekId;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class RebateCodeDayOfWeekRelation extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var BokaMeraDayOfWeek|null */
        public ?BokaMeraDayOfWeek $DayOfWeek=null,

        // @Required()
        /** @var int */
        public int $DayOfWeekId=0,

        // @Required()
        /** @var int */
        public int $RebateCodeId=0,

        // @Required()
        /** @var string */
        public string $CompanyId='',

        /** @var int */
        public int $Id=0,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['DayOfWeek'])) $this->DayOfWeek = JsonConverters::from('BokaMeraDayOfWeek', $o['DayOfWeek']);
        if (isset($o['DayOfWeekId'])) $this->DayOfWeekId = $o['DayOfWeekId'];
        if (isset($o['RebateCodeId'])) $this->RebateCodeId = $o['RebateCodeId'];
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->DayOfWeek)) $o['DayOfWeek'] = JsonConverters::to('BokaMeraDayOfWeek', $this->DayOfWeek);
        if (isset($this->DayOfWeekId)) $o['DayOfWeekId'] = $this->DayOfWeekId;
        if (isset($this->RebateCodeId)) $o['RebateCodeId'] = $this->RebateCodeId;
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        return empty($o) ? new class(){} : $o;
    }
}

class RebateCodeServiceRelation extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $CompanyId='',

        // @Required()
        /** @var int */
        public int $ServiceId=0,

        // @Required()
        /** @var int */
        public int $RebateCodeId=0,

        /** @var int */
        public int $Id=0,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['ServiceId'])) $this->ServiceId = $o['ServiceId'];
        if (isset($o['RebateCodeId'])) $this->RebateCodeId = $o['RebateCodeId'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->ServiceId)) $o['ServiceId'] = $this->ServiceId;
        if (isset($this->RebateCodeId)) $o['RebateCodeId'] = $this->RebateCodeId;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        return empty($o) ? new class(){} : $o;
    }
}

class RebateCodeBookingPriceRelation extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $CompanyId='',

        // @Required()
        /** @var int */
        public int $PriceId=0,

        // @Required()
        /** @var int */
        public int $RebateCodeId=0,

        /** @var int */
        public int $Id=0,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['PriceId'])) $this->PriceId = $o['PriceId'];
        if (isset($o['RebateCodeId'])) $this->RebateCodeId = $o['RebateCodeId'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->PriceId)) $o['PriceId'] = $this->PriceId;
        if (isset($this->RebateCodeId)) $o['RebateCodeId'] = $this->RebateCodeId;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        return empty($o) ? new class(){} : $o;
    }
}

class RebateCodeCustomerRelation extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $CompanyId='',

        // @Required()
        /** @var string */
        public string $CustomerId='',

        // @Required()
        /** @var int */
        public int $RebateCodeId=0,

        /** @var int */
        public int $Id=0,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['CustomerId'])) $this->CustomerId = $o['CustomerId'];
        if (isset($o['RebateCodeId'])) $this->RebateCodeId = $o['RebateCodeId'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->CustomerId)) $o['CustomerId'] = $this->CustomerId;
        if (isset($this->RebateCodeId)) $o['RebateCodeId'] = $this->RebateCodeId;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        return empty($o) ? new class(){} : $o;
    }
}

class DaysOfWeek extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $DayOfWeek='',

        // @Required()
        /** @var string */
        public string $DayOfWeekTranslation='',

        /** @var bool|null */
        public ?bool $DayOfWeekActive=null,
        /** @var int|null */
        public ?int $DayOfWeekSortOrder=null,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['DayOfWeek'])) $this->DayOfWeek = $o['DayOfWeek'];
        if (isset($o['DayOfWeekTranslation'])) $this->DayOfWeekTranslation = $o['DayOfWeekTranslation'];
        if (isset($o['DayOfWeekActive'])) $this->DayOfWeekActive = $o['DayOfWeekActive'];
        if (isset($o['DayOfWeekSortOrder'])) $this->DayOfWeekSortOrder = $o['DayOfWeekSortOrder'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->DayOfWeek)) $o['DayOfWeek'] = $this->DayOfWeek;
        if (isset($this->DayOfWeekTranslation)) $o['DayOfWeekTranslation'] = $this->DayOfWeekTranslation;
        if (isset($this->DayOfWeekActive)) $o['DayOfWeekActive'] = $this->DayOfWeekActive;
        if (isset($this->DayOfWeekSortOrder)) $o['DayOfWeekSortOrder'] = $this->DayOfWeekSortOrder;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class UserAccessKeys extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $CompanyId='',

        // @Required()
        /** @var int */
        public int $AccessKeyTypeId=0,

        // @Required()
        /** @var string */
        public string $Value='',

        // @Required()
        /** @var string */
        public string $CustomerId='',

        /** @var string|null */
        public ?string $Description=null,
        // @Required()
        /** @var string */
        public string $Id=''
    ) {
    }

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

class ExternalReference extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $CompanyId='',

        // @Required()
        /** @var string */
        public string $Id='',

        // @Required()
        /** @var string */
        public string $OwnerId='',

        // @Required()
        /** @var string */
        public string $ReferenceType='',

        /** @var string|null */
        public ?string $ExternalData=null,
        /** @var string|null */
        public ?string $CreatedBy=null,
        // @Required()
        /** @var DateTime */
        public DateTime $Updated=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $Created=new DateTime(),

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        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']);
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        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);
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        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 CustomerComment extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $CompanyId='',

        /** @var int */
        public int $Id=0,
        // @Required()
        /** @var string */
        public string $CustomerId='',

        // @Required()
        /** @var string */
        public string $Comments='',

        // @Required()
        /** @var DateTime */
        public DateTime $Updated=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $Created=new DateTime(),

        /** @var string|null */
        public ?string $ImageUrl=null,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null
    ) {
    }

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

enum CustomerType : string
{
    case Person = 'Person';
    case Business = 'Business';
}

class Customer implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $City=null,
        /** @var string|null */
        public ?string $CountryCode=null,
        /** @var string|null */
        public ?string $IdentityNumber=null,
        /** @var string|null */
        public ?string $Email=null,
        /** @var string|null */
        public ?string $FirstName=null,
        /** @var string|null */
        public ?string $LastName=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var string|null */
        public ?string $PostalCode=null,
        /** @var string|null */
        public ?string $Street=null,
        /** @var string|null */
        public ?string $Reference=null,
        /** @var CustomerType|null */
        public ?CustomerType $Type=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['City'])) $this->City = $o['City'];
        if (isset($o['CountryCode'])) $this->CountryCode = $o['CountryCode'];
        if (isset($o['IdentityNumber'])) $this->IdentityNumber = $o['IdentityNumber'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
        if (isset($o['LastName'])) $this->LastName = $o['LastName'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['PostalCode'])) $this->PostalCode = $o['PostalCode'];
        if (isset($o['Street'])) $this->Street = $o['Street'];
        if (isset($o['Reference'])) $this->Reference = $o['Reference'];
        if (isset($o['Type'])) $this->Type = JsonConverters::from('CustomerType', $o['Type']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->City)) $o['City'] = $this->City;
        if (isset($this->CountryCode)) $o['CountryCode'] = $this->CountryCode;
        if (isset($this->IdentityNumber)) $o['IdentityNumber'] = $this->IdentityNumber;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
        if (isset($this->LastName)) $o['LastName'] = $this->LastName;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->PostalCode)) $o['PostalCode'] = $this->PostalCode;
        if (isset($this->Street)) $o['Street'] = $this->Street;
        if (isset($this->Reference)) $o['Reference'] = $this->Reference;
        if (isset($this->Type)) $o['Type'] = JsonConverters::to('CustomerType', $this->Type);
        return empty($o) ? new class(){} : $o;
    }
}

class RebateCodeStatus extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        /** @var string|null */
        public ?string $Description=null,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class RebateCode extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @References("typeof(BokaMera.API.ServiceModel.Db.RebateCodeType)")
        /** @var int */
        public int $RebateCodeTypeId=0,

        /** @var RebateCodeType|null */
        public ?RebateCodeType $RebateCodeTypeInfo=null,
        // @References("typeof(BokaMera.API.ServiceModel.Db.RebateCodeStatus)")
        /** @var int */
        public int $RebateCodeStatusId=0,

        /** @var RebateCodeType|null */
        public ?RebateCodeType $RebateCodeStatusInfo=null,
        // @Ignore()
        /** @var array<Service>|null */
        public ?array $Services=null,

        /** @var array<RebateCodeDayOfWeekRelation>|null */
        public ?array $RebateCodeDayOfWeekRelation=null,
        /** @var array<RebateCodeServiceRelation>|null */
        public ?array $RebateCodeServiceRelation=null,
        /** @var array<RebateCodeBookingPriceRelation>|null */
        public ?array $RebateCodeBookingPriceRelation=null,
        /** @var array<RebateCodeCustomerRelation>|null */
        public ?array $RebateCodeCustomerRelation=null,
        // @Ignore()
        /** @var array<DaysOfWeek>|null */
        public ?array $DaysOfWeek=null,

        // @Ignore()
        /** @var array<Customer>|null */
        public ?array $Customers=null,

        // @Ignore()
        /** @var RebateCodeStatus|null */
        public ?RebateCodeStatus $RebateCodeStatus=null,

        // @Ignore()
        /** @var RebateCodeType|null */
        public ?RebateCodeType $RebateCodeType=null,

        // @Ignore()
        /** @var int */
        public int $CurrentNumberOfUsesPerCustomer=0,

        // @Ignore()
        /** @var bool|null */
        public ?bool $IsSpecificByDayOfWeek=null,

        // @Ignore()
        /** @var bool|null */
        public ?bool $Active=null,

        /** @var string */
        public string $CompanyId='',
        // @Required()
        /** @var DateTime */
        public DateTime $ValidFrom=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $ValidTo=new DateTime(),

        // @Required()
        /** @var string */
        public string $RebateCodeSign='',

        // @Required()
        /** @var int */
        public int $RebateCodeValue=0,

        // @Required()
        /** @var int */
        public int $MaxNumberOfUses=0,

        // @Required()
        /** @var int */
        public int $MaxNumberOfUsesPerCustomer=0,

        // @Required()
        /** @var int */
        public int $NumberOfUsesUsed=0,

        /** @var string|null */
        public ?string $PersonalNote=null,
        // @Required()
        /** @var string */
        public string $CreatedBy='',

        // @Required()
        /** @var DateTime */
        public DateTime $Created=new DateTime(),

        // @Required()
        /** @var string */
        public string $UpdatedBy='',

        // @Required()
        /** @var DateTime */
        public DateTime $Updated=new DateTime(),

        // @Required()
        /** @var DateInterval|null */
        public ?DateInterval $FromTime=null,

        // @Required()
        /** @var DateInterval|null */
        public ?DateInterval $ToTime=null,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['RebateCodeTypeId'])) $this->RebateCodeTypeId = $o['RebateCodeTypeId'];
        if (isset($o['RebateCodeTypeInfo'])) $this->RebateCodeTypeInfo = JsonConverters::from('RebateCodeType', $o['RebateCodeTypeInfo']);
        if (isset($o['RebateCodeStatusId'])) $this->RebateCodeStatusId = $o['RebateCodeStatusId'];
        if (isset($o['RebateCodeStatusInfo'])) $this->RebateCodeStatusInfo = JsonConverters::from('RebateCodeType', $o['RebateCodeStatusInfo']);
        if (isset($o['Services'])) $this->Services = JsonConverters::fromArray('Service', $o['Services']);
        if (isset($o['RebateCodeDayOfWeekRelation'])) $this->RebateCodeDayOfWeekRelation = JsonConverters::fromArray('RebateCodeDayOfWeekRelation', $o['RebateCodeDayOfWeekRelation']);
        if (isset($o['RebateCodeServiceRelation'])) $this->RebateCodeServiceRelation = JsonConverters::fromArray('RebateCodeServiceRelation', $o['RebateCodeServiceRelation']);
        if (isset($o['RebateCodeBookingPriceRelation'])) $this->RebateCodeBookingPriceRelation = JsonConverters::fromArray('RebateCodeBookingPriceRelation', $o['RebateCodeBookingPriceRelation']);
        if (isset($o['RebateCodeCustomerRelation'])) $this->RebateCodeCustomerRelation = JsonConverters::fromArray('RebateCodeCustomerRelation', $o['RebateCodeCustomerRelation']);
        if (isset($o['DaysOfWeek'])) $this->DaysOfWeek = JsonConverters::fromArray('DaysOfWeek', $o['DaysOfWeek']);
        if (isset($o['Customers'])) $this->Customers = JsonConverters::fromArray('Customer', $o['Customers']);
        if (isset($o['RebateCodeStatus'])) $this->RebateCodeStatus = JsonConverters::from('RebateCodeStatus', $o['RebateCodeStatus']);
        if (isset($o['RebateCodeType'])) $this->RebateCodeType = JsonConverters::from('RebateCodeType', $o['RebateCodeType']);
        if (isset($o['CurrentNumberOfUsesPerCustomer'])) $this->CurrentNumberOfUsesPerCustomer = $o['CurrentNumberOfUsesPerCustomer'];
        if (isset($o['IsSpecificByDayOfWeek'])) $this->IsSpecificByDayOfWeek = $o['IsSpecificByDayOfWeek'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['ValidFrom'])) $this->ValidFrom = JsonConverters::from('DateTime', $o['ValidFrom']);
        if (isset($o['ValidTo'])) $this->ValidTo = JsonConverters::from('DateTime', $o['ValidTo']);
        if (isset($o['RebateCodeSign'])) $this->RebateCodeSign = $o['RebateCodeSign'];
        if (isset($o['RebateCodeValue'])) $this->RebateCodeValue = $o['RebateCodeValue'];
        if (isset($o['MaxNumberOfUses'])) $this->MaxNumberOfUses = $o['MaxNumberOfUses'];
        if (isset($o['MaxNumberOfUsesPerCustomer'])) $this->MaxNumberOfUsesPerCustomer = $o['MaxNumberOfUsesPerCustomer'];
        if (isset($o['NumberOfUsesUsed'])) $this->NumberOfUsesUsed = $o['NumberOfUsesUsed'];
        if (isset($o['PersonalNote'])) $this->PersonalNote = $o['PersonalNote'];
        if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['UpdatedBy'])) $this->UpdatedBy = $o['UpdatedBy'];
        if (isset($o['Updated'])) $this->Updated = JsonConverters::from('DateTime', $o['Updated']);
        if (isset($o['FromTime'])) $this->FromTime = JsonConverters::from('DateInterval', $o['FromTime']);
        if (isset($o['ToTime'])) $this->ToTime = JsonConverters::from('DateInterval', $o['ToTime']);
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->RebateCodeTypeId)) $o['RebateCodeTypeId'] = $this->RebateCodeTypeId;
        if (isset($this->RebateCodeTypeInfo)) $o['RebateCodeTypeInfo'] = JsonConverters::to('RebateCodeType', $this->RebateCodeTypeInfo);
        if (isset($this->RebateCodeStatusId)) $o['RebateCodeStatusId'] = $this->RebateCodeStatusId;
        if (isset($this->RebateCodeStatusInfo)) $o['RebateCodeStatusInfo'] = JsonConverters::to('RebateCodeType', $this->RebateCodeStatusInfo);
        if (isset($this->Services)) $o['Services'] = JsonConverters::toArray('Service', $this->Services);
        if (isset($this->RebateCodeDayOfWeekRelation)) $o['RebateCodeDayOfWeekRelation'] = JsonConverters::toArray('RebateCodeDayOfWeekRelation', $this->RebateCodeDayOfWeekRelation);
        if (isset($this->RebateCodeServiceRelation)) $o['RebateCodeServiceRelation'] = JsonConverters::toArray('RebateCodeServiceRelation', $this->RebateCodeServiceRelation);
        if (isset($this->RebateCodeBookingPriceRelation)) $o['RebateCodeBookingPriceRelation'] = JsonConverters::toArray('RebateCodeBookingPriceRelation', $this->RebateCodeBookingPriceRelation);
        if (isset($this->RebateCodeCustomerRelation)) $o['RebateCodeCustomerRelation'] = JsonConverters::toArray('RebateCodeCustomerRelation', $this->RebateCodeCustomerRelation);
        if (isset($this->DaysOfWeek)) $o['DaysOfWeek'] = JsonConverters::toArray('DaysOfWeek', $this->DaysOfWeek);
        if (isset($this->Customers)) $o['Customers'] = JsonConverters::toArray('Customer', $this->Customers);
        if (isset($this->RebateCodeStatus)) $o['RebateCodeStatus'] = JsonConverters::to('RebateCodeStatus', $this->RebateCodeStatus);
        if (isset($this->RebateCodeType)) $o['RebateCodeType'] = JsonConverters::to('RebateCodeType', $this->RebateCodeType);
        if (isset($this->CurrentNumberOfUsesPerCustomer)) $o['CurrentNumberOfUsesPerCustomer'] = $this->CurrentNumberOfUsesPerCustomer;
        if (isset($this->IsSpecificByDayOfWeek)) $o['IsSpecificByDayOfWeek'] = $this->IsSpecificByDayOfWeek;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->ValidFrom)) $o['ValidFrom'] = JsonConverters::to('DateTime', $this->ValidFrom);
        if (isset($this->ValidTo)) $o['ValidTo'] = JsonConverters::to('DateTime', $this->ValidTo);
        if (isset($this->RebateCodeSign)) $o['RebateCodeSign'] = $this->RebateCodeSign;
        if (isset($this->RebateCodeValue)) $o['RebateCodeValue'] = $this->RebateCodeValue;
        if (isset($this->MaxNumberOfUses)) $o['MaxNumberOfUses'] = $this->MaxNumberOfUses;
        if (isset($this->MaxNumberOfUsesPerCustomer)) $o['MaxNumberOfUsesPerCustomer'] = $this->MaxNumberOfUsesPerCustomer;
        if (isset($this->NumberOfUsesUsed)) $o['NumberOfUsesUsed'] = $this->NumberOfUsesUsed;
        if (isset($this->PersonalNote)) $o['PersonalNote'] = $this->PersonalNote;
        if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->UpdatedBy)) $o['UpdatedBy'] = $this->UpdatedBy;
        if (isset($this->Updated)) $o['Updated'] = JsonConverters::to('DateTime', $this->Updated);
        if (isset($this->FromTime)) $o['FromTime'] = JsonConverters::to('DateInterval', $this->FromTime);
        if (isset($this->ToTime)) $o['ToTime'] = JsonConverters::to('DateInterval', $this->ToTime);
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class ServicePrice extends BaseModel implements IInterval, JsonSerializable
{
    public function __construct(
        // @References("typeof(BokaMera.API.ServiceModel.Db.Currency)")
        /** @var string|null */
        public ?string $CurrencyId=null,

        /** @var Currency|null */
        public ?Currency $CurrencyInfo=null,
        // @Ignore()
        /** @var Service|null */
        public ?Service $Service=null,

        // @Ignore()
        /** @var array<PriceMapping>|null */
        public ?array $PriceMappings=null,

        // @Ignore()
        /** @var bool|null */
        public ?bool $isTimeSpecific=null,

        // @Ignore()
        /** @var bool|null */
        public ?bool $isDaysOfWeekSpecific=null,

        /** @var array<ServicePriceDayOfWeekRelation>|null */
        public ?array $DayOfWeeks=null,
        // @Ignore()
        /** @var float|null */
        public ?float $PriceBeforeRebate=null,

        // @Ignore()
        /** @var array<RebateCode>|null */
        public ?array $RebateCodesApplied=null,

        // @Ignore()
        /** @var string|null */
        public ?string $PriceText=null,

        // @Ignore()
        /** @var bool|null */
        public ?bool $IsWeighted=null,

        // @Ignore()
        /** @var array<ServicePrice>|null */
        public ?array $OverlappingPrices=null,

        // @Required()
        /** @var string */
        public string $CompanyId='',

        /** @var int */
        public int $Id=0,
        // @Required()
        /** @var int */
        public int $ServiceId=0,

        /** @var float|null */
        public ?float $Price=null,
        // @Required()
        /** @var DateTime */
        public DateTime $Updated=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $Created=new DateTime(),

        // @Required()
        /** @var DateInterval|null */
        public ?DateInterval $FromTime=null,

        // @Required()
        /** @var DateInterval|null */
        public ?DateInterval $ToTime=null,

        // @Required()
        /** @var float */
        public float $VAT=0.0,

        /** @var string|null */
        public ?string $Category=null,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var DateTime */
        public DateTime $From=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $To=new DateTime(),

        // @Required()
        /** @var int */
        public int $CalculationTypeId=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['CurrencyId'])) $this->CurrencyId = $o['CurrencyId'];
        if (isset($o['CurrencyInfo'])) $this->CurrencyInfo = JsonConverters::from('Currency', $o['CurrencyInfo']);
        if (isset($o['Service'])) $this->Service = JsonConverters::from('Service', $o['Service']);
        if (isset($o['PriceMappings'])) $this->PriceMappings = JsonConverters::fromArray('PriceMapping', $o['PriceMappings']);
        if (isset($o['isTimeSpecific'])) $this->isTimeSpecific = $o['isTimeSpecific'];
        if (isset($o['isDaysOfWeekSpecific'])) $this->isDaysOfWeekSpecific = $o['isDaysOfWeekSpecific'];
        if (isset($o['DayOfWeeks'])) $this->DayOfWeeks = JsonConverters::fromArray('ServicePriceDayOfWeekRelation', $o['DayOfWeeks']);
        if (isset($o['PriceBeforeRebate'])) $this->PriceBeforeRebate = $o['PriceBeforeRebate'];
        if (isset($o['RebateCodesApplied'])) $this->RebateCodesApplied = JsonConverters::fromArray('RebateCode', $o['RebateCodesApplied']);
        if (isset($o['PriceText'])) $this->PriceText = $o['PriceText'];
        if (isset($o['IsWeighted'])) $this->IsWeighted = $o['IsWeighted'];
        if (isset($o['OverlappingPrices'])) $this->OverlappingPrices = JsonConverters::fromArray('ServicePrice', $o['OverlappingPrices']);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['ServiceId'])) $this->ServiceId = $o['ServiceId'];
        if (isset($o['Price'])) $this->Price = $o['Price'];
        if (isset($o['Updated'])) $this->Updated = JsonConverters::from('DateTime', $o['Updated']);
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['FromTime'])) $this->FromTime = JsonConverters::from('DateInterval', $o['FromTime']);
        if (isset($o['ToTime'])) $this->ToTime = JsonConverters::from('DateInterval', $o['ToTime']);
        if (isset($o['VAT'])) $this->VAT = $o['VAT'];
        if (isset($o['Category'])) $this->Category = $o['Category'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        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['CalculationTypeId'])) $this->CalculationTypeId = $o['CalculationTypeId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->CurrencyId)) $o['CurrencyId'] = $this->CurrencyId;
        if (isset($this->CurrencyInfo)) $o['CurrencyInfo'] = JsonConverters::to('Currency', $this->CurrencyInfo);
        if (isset($this->Service)) $o['Service'] = JsonConverters::to('Service', $this->Service);
        if (isset($this->PriceMappings)) $o['PriceMappings'] = JsonConverters::toArray('PriceMapping', $this->PriceMappings);
        if (isset($this->isTimeSpecific)) $o['isTimeSpecific'] = $this->isTimeSpecific;
        if (isset($this->isDaysOfWeekSpecific)) $o['isDaysOfWeekSpecific'] = $this->isDaysOfWeekSpecific;
        if (isset($this->DayOfWeeks)) $o['DayOfWeeks'] = JsonConverters::toArray('ServicePriceDayOfWeekRelation', $this->DayOfWeeks);
        if (isset($this->PriceBeforeRebate)) $o['PriceBeforeRebate'] = $this->PriceBeforeRebate;
        if (isset($this->RebateCodesApplied)) $o['RebateCodesApplied'] = JsonConverters::toArray('RebateCode', $this->RebateCodesApplied);
        if (isset($this->PriceText)) $o['PriceText'] = $this->PriceText;
        if (isset($this->IsWeighted)) $o['IsWeighted'] = $this->IsWeighted;
        if (isset($this->OverlappingPrices)) $o['OverlappingPrices'] = JsonConverters::toArray('ServicePrice', $this->OverlappingPrices);
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->ServiceId)) $o['ServiceId'] = $this->ServiceId;
        if (isset($this->Price)) $o['Price'] = $this->Price;
        if (isset($this->Updated)) $o['Updated'] = JsonConverters::to('DateTime', $this->Updated);
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->FromTime)) $o['FromTime'] = JsonConverters::to('DateInterval', $this->FromTime);
        if (isset($this->ToTime)) $o['ToTime'] = JsonConverters::to('DateInterval', $this->ToTime);
        if (isset($this->VAT)) $o['VAT'] = $this->VAT;
        if (isset($this->Category)) $o['Category'] = $this->Category;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        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->CalculationTypeId)) $o['CalculationTypeId'] = $this->CalculationTypeId;
        return empty($o) ? new class(){} : $o;
    }
}

class BookingStatusOptions 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
    ) {
    }

    /** @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 ScheduleView extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class WeekNumberSetting extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Description='',

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class BookingTemplate extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Description='',

        // @Required()
        /** @var string */
        public string $UsedByApplication='',

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['UsedByApplication'])) $this->UsedByApplication = $o['UsedByApplication'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->UsedByApplication)) $o['UsedByApplication'] = $this->UsedByApplication;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class CalendarType extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Description='',

        // @Required()
        /** @var bool|null */
        public ?bool $Active=null,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class FreeSpotTexts extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $TextSingular='',

        // @Required()
        /** @var string */
        public string $TextPlural='',

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['TextSingular'])) $this->TextSingular = $o['TextSingular'];
        if (isset($o['TextPlural'])) $this->TextPlural = $o['TextPlural'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->TextSingular)) $o['TextSingular'] = $this->TextSingular;
        if (isset($this->TextPlural)) $o['TextPlural'] = $this->TextPlural;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class BookingSettings extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @References("typeof(BokaMera.API.ServiceModel.Db.FreeSpotTexts)")
        /** @var int */
        public int $FreeSpotTextsId=0,

        // @Ignore()
        /** @var bool|null */
        public ?bool $SendEmailConfirmation=null,

        // @Ignore()
        /** @var array<ScheduleView>|null */
        public ?array $ScheduleViewOptions=null,

        // @Ignore()
        /** @var array<WeekNumberSetting>|null */
        public ?array $WeekNumberSettingOptions=null,

        // @Ignore()
        /** @var array<BookingTemplate>|null */
        public ?array $BookingTemplateOptions=null,

        // @Ignore()
        /** @var array<CalendarType>|null */
        public ?array $CalendarTypeOptions=null,

        // @Ignore()
        /** @var array<FreeSpotTexts>|null */
        public ?array $FreeSpotTextOptions=null,

        // @Ignore()
        /** @var array<BookingStatusOptions>|null */
        public ?array $BookingStatusOptions=null,

        /** @var FreeSpotTexts|null */
        public ?FreeSpotTexts $FreeSpotTextsInfo=null,
        // @Ignore()
        /** @var string|null */
        public ?string $FreeSpotsTextSingular=null,

        // @Ignore()
        /** @var string|null */
        public ?string $FreeSpotsTextPlural=null,

        // @Required()
        /** @var int */
        public int $BookingStatusId=0,

        // @Required()
        /** @var int */
        public int $ScheduleViewId=0,

        // @Required()
        /** @var int */
        public int $BookingTemplateId=0,

        // @Required()
        /** @var int */
        public int $CalendarTypeId=0,

        // @Required()
        /** @var bool|null */
        public ?bool $AllowBookingOnUnbookedTimes=null,

        // @Required()
        /** @var bool|null */
        public ?bool $SendEmailReminder=null,

        // @Required()
        /** @var bool|null */
        public ?bool $SendSmsReminder=null,

        // @Required()
        /** @var bool|null */
        public ?bool $SendSmsConfirmation=null,

        // @Required()
        /** @var int */
        public int $EmailReminderTime=0,

        // @Required()
        /** @var int */
        public int $SmsReminderTime=0,

        // @Required()
        /** @var int */
        public int $MaxActiveBookings=0,

        // @Required()
        /** @var bool|null */
        public ?bool $SendNotifications=null,

        /** @var string|null */
        public ?string $SendNotificationsEmail=null,
        // @Required()
        /** @var bool|null */
        public ?bool $EnableMobileApp=null,

        /** @var DateInterval|null */
        public ?DateInterval $ScheduleStartTime=null,
        /** @var DateInterval|null */
        public ?DateInterval $ScheduleEndTime=null,
        /** @var string|null */
        public ?string $ReceiptTemplate=null,
        // @Required()
        /** @var int */
        public int $ScheduleTimeSlotMinutes=0,

        // @Required()
        /** @var bool|null */
        public ?bool $ShowFreeTimesLeft=null,

        // @Required()
        /** @var bool|null */
        public ?bool $EnableICalGroupBookings=null,

        /** @var string|null */
        public ?string $AgreementTemplate=null,
        // @Required()
        /** @var bool|null */
        public ?bool $ScheduleShowTimeExeptions=null,

        // @Required()
        /** @var bool|null */
        public ?bool $EnableBookingsOnSameTime=null,

        // @Required()
        /** @var int */
        public int $ShowWeekNumberSettingId=0,

        // @Required()
        /** @var bool|null */
        public ?bool $EnableShowBookedTimes=null,

        // @Required()
        /** @var bool|null */
        public ?bool $EnableSendFollowUpMessage=null,

        // @Required()
        /** @var int */
        public int $FollowUpMessageTime=0,

        /** @var string|null */
        public ?string $MessageText=null,
        // @Required()
        /** @var bool|null */
        public ?bool $ScheduleGroupResources=null,

        // @Required()
        /** @var int */
        public int $BookSpotUserResponseMinutes=0,

        // @Required()
        /** @var bool|null */
        public ?bool $IsBookSpotDirectly=null,

        // @Required()
        /** @var int */
        public int $BookSpotDirectlyTimeLeftMinutes=0,

        // @Required()
        /** @var bool|null */
        public ?bool $SendEmailNotificationQueue=null,

        // @Required()
        /** @var bool|null */
        public ?bool $SendSMSNotificationQueue=null,

        // @Required()
        /** @var bool|null */
        public ?bool $SchedulerDisableHorizontalScrolling=null,

        // @Required()
        /** @var bool|null */
        public ?bool $BookOnlyOnExistingCustomers=null,

        // @Required()
        /** @var bool|null */
        public ?bool $AutoGenerateUniquePinCode=null,

        // @Required()
        /** @var bool|null */
        public ?bool $WeightedPrices=null,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var bool|null */
        public ?bool $AutoCreateUserProfile=null,

        /** @var bool|null */
        public ?bool $ShowMultipleResourcesAsOne=null,
        /** @var bool|null */
        public ?bool $ShowMultiDayAsTime=null,
        // @Required()
        /** @var string */
        public string $Id=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['FreeSpotTextsId'])) $this->FreeSpotTextsId = $o['FreeSpotTextsId'];
        if (isset($o['SendEmailConfirmation'])) $this->SendEmailConfirmation = $o['SendEmailConfirmation'];
        if (isset($o['ScheduleViewOptions'])) $this->ScheduleViewOptions = JsonConverters::fromArray('ScheduleView', $o['ScheduleViewOptions']);
        if (isset($o['WeekNumberSettingOptions'])) $this->WeekNumberSettingOptions = JsonConverters::fromArray('WeekNumberSetting', $o['WeekNumberSettingOptions']);
        if (isset($o['BookingTemplateOptions'])) $this->BookingTemplateOptions = JsonConverters::fromArray('BookingTemplate', $o['BookingTemplateOptions']);
        if (isset($o['CalendarTypeOptions'])) $this->CalendarTypeOptions = JsonConverters::fromArray('CalendarType', $o['CalendarTypeOptions']);
        if (isset($o['FreeSpotTextOptions'])) $this->FreeSpotTextOptions = JsonConverters::fromArray('FreeSpotTexts', $o['FreeSpotTextOptions']);
        if (isset($o['BookingStatusOptions'])) $this->BookingStatusOptions = JsonConverters::fromArray('BookingStatusOptions', $o['BookingStatusOptions']);
        if (isset($o['FreeSpotTextsInfo'])) $this->FreeSpotTextsInfo = JsonConverters::from('FreeSpotTexts', $o['FreeSpotTextsInfo']);
        if (isset($o['FreeSpotsTextSingular'])) $this->FreeSpotsTextSingular = $o['FreeSpotsTextSingular'];
        if (isset($o['FreeSpotsTextPlural'])) $this->FreeSpotsTextPlural = $o['FreeSpotsTextPlural'];
        if (isset($o['BookingStatusId'])) $this->BookingStatusId = $o['BookingStatusId'];
        if (isset($o['ScheduleViewId'])) $this->ScheduleViewId = $o['ScheduleViewId'];
        if (isset($o['BookingTemplateId'])) $this->BookingTemplateId = $o['BookingTemplateId'];
        if (isset($o['CalendarTypeId'])) $this->CalendarTypeId = $o['CalendarTypeId'];
        if (isset($o['AllowBookingOnUnbookedTimes'])) $this->AllowBookingOnUnbookedTimes = $o['AllowBookingOnUnbookedTimes'];
        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['EmailReminderTime'])) $this->EmailReminderTime = $o['EmailReminderTime'];
        if (isset($o['SmsReminderTime'])) $this->SmsReminderTime = $o['SmsReminderTime'];
        if (isset($o['MaxActiveBookings'])) $this->MaxActiveBookings = $o['MaxActiveBookings'];
        if (isset($o['SendNotifications'])) $this->SendNotifications = $o['SendNotifications'];
        if (isset($o['SendNotificationsEmail'])) $this->SendNotificationsEmail = $o['SendNotificationsEmail'];
        if (isset($o['EnableMobileApp'])) $this->EnableMobileApp = $o['EnableMobileApp'];
        if (isset($o['ScheduleStartTime'])) $this->ScheduleStartTime = JsonConverters::from('TimeSpan', $o['ScheduleStartTime']);
        if (isset($o['ScheduleEndTime'])) $this->ScheduleEndTime = JsonConverters::from('TimeSpan', $o['ScheduleEndTime']);
        if (isset($o['ReceiptTemplate'])) $this->ReceiptTemplate = $o['ReceiptTemplate'];
        if (isset($o['ScheduleTimeSlotMinutes'])) $this->ScheduleTimeSlotMinutes = $o['ScheduleTimeSlotMinutes'];
        if (isset($o['ShowFreeTimesLeft'])) $this->ShowFreeTimesLeft = $o['ShowFreeTimesLeft'];
        if (isset($o['EnableICalGroupBookings'])) $this->EnableICalGroupBookings = $o['EnableICalGroupBookings'];
        if (isset($o['AgreementTemplate'])) $this->AgreementTemplate = $o['AgreementTemplate'];
        if (isset($o['ScheduleShowTimeExeptions'])) $this->ScheduleShowTimeExeptions = $o['ScheduleShowTimeExeptions'];
        if (isset($o['EnableBookingsOnSameTime'])) $this->EnableBookingsOnSameTime = $o['EnableBookingsOnSameTime'];
        if (isset($o['ShowWeekNumberSettingId'])) $this->ShowWeekNumberSettingId = $o['ShowWeekNumberSettingId'];
        if (isset($o['EnableShowBookedTimes'])) $this->EnableShowBookedTimes = $o['EnableShowBookedTimes'];
        if (isset($o['EnableSendFollowUpMessage'])) $this->EnableSendFollowUpMessage = $o['EnableSendFollowUpMessage'];
        if (isset($o['FollowUpMessageTime'])) $this->FollowUpMessageTime = $o['FollowUpMessageTime'];
        if (isset($o['MessageText'])) $this->MessageText = $o['MessageText'];
        if (isset($o['ScheduleGroupResources'])) $this->ScheduleGroupResources = $o['ScheduleGroupResources'];
        if (isset($o['BookSpotUserResponseMinutes'])) $this->BookSpotUserResponseMinutes = $o['BookSpotUserResponseMinutes'];
        if (isset($o['IsBookSpotDirectly'])) $this->IsBookSpotDirectly = $o['IsBookSpotDirectly'];
        if (isset($o['BookSpotDirectlyTimeLeftMinutes'])) $this->BookSpotDirectlyTimeLeftMinutes = $o['BookSpotDirectlyTimeLeftMinutes'];
        if (isset($o['SendEmailNotificationQueue'])) $this->SendEmailNotificationQueue = $o['SendEmailNotificationQueue'];
        if (isset($o['SendSMSNotificationQueue'])) $this->SendSMSNotificationQueue = $o['SendSMSNotificationQueue'];
        if (isset($o['SchedulerDisableHorizontalScrolling'])) $this->SchedulerDisableHorizontalScrolling = $o['SchedulerDisableHorizontalScrolling'];
        if (isset($o['BookOnlyOnExistingCustomers'])) $this->BookOnlyOnExistingCustomers = $o['BookOnlyOnExistingCustomers'];
        if (isset($o['AutoGenerateUniquePinCode'])) $this->AutoGenerateUniquePinCode = $o['AutoGenerateUniquePinCode'];
        if (isset($o['WeightedPrices'])) $this->WeightedPrices = $o['WeightedPrices'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['AutoCreateUserProfile'])) $this->AutoCreateUserProfile = $o['AutoCreateUserProfile'];
        if (isset($o['ShowMultipleResourcesAsOne'])) $this->ShowMultipleResourcesAsOne = $o['ShowMultipleResourcesAsOne'];
        if (isset($o['ShowMultiDayAsTime'])) $this->ShowMultiDayAsTime = $o['ShowMultiDayAsTime'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->FreeSpotTextsId)) $o['FreeSpotTextsId'] = $this->FreeSpotTextsId;
        if (isset($this->SendEmailConfirmation)) $o['SendEmailConfirmation'] = $this->SendEmailConfirmation;
        if (isset($this->ScheduleViewOptions)) $o['ScheduleViewOptions'] = JsonConverters::toArray('ScheduleView', $this->ScheduleViewOptions);
        if (isset($this->WeekNumberSettingOptions)) $o['WeekNumberSettingOptions'] = JsonConverters::toArray('WeekNumberSetting', $this->WeekNumberSettingOptions);
        if (isset($this->BookingTemplateOptions)) $o['BookingTemplateOptions'] = JsonConverters::toArray('BookingTemplate', $this->BookingTemplateOptions);
        if (isset($this->CalendarTypeOptions)) $o['CalendarTypeOptions'] = JsonConverters::toArray('CalendarType', $this->CalendarTypeOptions);
        if (isset($this->FreeSpotTextOptions)) $o['FreeSpotTextOptions'] = JsonConverters::toArray('FreeSpotTexts', $this->FreeSpotTextOptions);
        if (isset($this->BookingStatusOptions)) $o['BookingStatusOptions'] = JsonConverters::toArray('BookingStatusOptions', $this->BookingStatusOptions);
        if (isset($this->FreeSpotTextsInfo)) $o['FreeSpotTextsInfo'] = JsonConverters::to('FreeSpotTexts', $this->FreeSpotTextsInfo);
        if (isset($this->FreeSpotsTextSingular)) $o['FreeSpotsTextSingular'] = $this->FreeSpotsTextSingular;
        if (isset($this->FreeSpotsTextPlural)) $o['FreeSpotsTextPlural'] = $this->FreeSpotsTextPlural;
        if (isset($this->BookingStatusId)) $o['BookingStatusId'] = $this->BookingStatusId;
        if (isset($this->ScheduleViewId)) $o['ScheduleViewId'] = $this->ScheduleViewId;
        if (isset($this->BookingTemplateId)) $o['BookingTemplateId'] = $this->BookingTemplateId;
        if (isset($this->CalendarTypeId)) $o['CalendarTypeId'] = $this->CalendarTypeId;
        if (isset($this->AllowBookingOnUnbookedTimes)) $o['AllowBookingOnUnbookedTimes'] = $this->AllowBookingOnUnbookedTimes;
        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->EmailReminderTime)) $o['EmailReminderTime'] = $this->EmailReminderTime;
        if (isset($this->SmsReminderTime)) $o['SmsReminderTime'] = $this->SmsReminderTime;
        if (isset($this->MaxActiveBookings)) $o['MaxActiveBookings'] = $this->MaxActiveBookings;
        if (isset($this->SendNotifications)) $o['SendNotifications'] = $this->SendNotifications;
        if (isset($this->SendNotificationsEmail)) $o['SendNotificationsEmail'] = $this->SendNotificationsEmail;
        if (isset($this->EnableMobileApp)) $o['EnableMobileApp'] = $this->EnableMobileApp;
        if (isset($this->ScheduleStartTime)) $o['ScheduleStartTime'] = JsonConverters::to('TimeSpan', $this->ScheduleStartTime);
        if (isset($this->ScheduleEndTime)) $o['ScheduleEndTime'] = JsonConverters::to('TimeSpan', $this->ScheduleEndTime);
        if (isset($this->ReceiptTemplate)) $o['ReceiptTemplate'] = $this->ReceiptTemplate;
        if (isset($this->ScheduleTimeSlotMinutes)) $o['ScheduleTimeSlotMinutes'] = $this->ScheduleTimeSlotMinutes;
        if (isset($this->ShowFreeTimesLeft)) $o['ShowFreeTimesLeft'] = $this->ShowFreeTimesLeft;
        if (isset($this->EnableICalGroupBookings)) $o['EnableICalGroupBookings'] = $this->EnableICalGroupBookings;
        if (isset($this->AgreementTemplate)) $o['AgreementTemplate'] = $this->AgreementTemplate;
        if (isset($this->ScheduleShowTimeExeptions)) $o['ScheduleShowTimeExeptions'] = $this->ScheduleShowTimeExeptions;
        if (isset($this->EnableBookingsOnSameTime)) $o['EnableBookingsOnSameTime'] = $this->EnableBookingsOnSameTime;
        if (isset($this->ShowWeekNumberSettingId)) $o['ShowWeekNumberSettingId'] = $this->ShowWeekNumberSettingId;
        if (isset($this->EnableShowBookedTimes)) $o['EnableShowBookedTimes'] = $this->EnableShowBookedTimes;
        if (isset($this->EnableSendFollowUpMessage)) $o['EnableSendFollowUpMessage'] = $this->EnableSendFollowUpMessage;
        if (isset($this->FollowUpMessageTime)) $o['FollowUpMessageTime'] = $this->FollowUpMessageTime;
        if (isset($this->MessageText)) $o['MessageText'] = $this->MessageText;
        if (isset($this->ScheduleGroupResources)) $o['ScheduleGroupResources'] = $this->ScheduleGroupResources;
        if (isset($this->BookSpotUserResponseMinutes)) $o['BookSpotUserResponseMinutes'] = $this->BookSpotUserResponseMinutes;
        if (isset($this->IsBookSpotDirectly)) $o['IsBookSpotDirectly'] = $this->IsBookSpotDirectly;
        if (isset($this->BookSpotDirectlyTimeLeftMinutes)) $o['BookSpotDirectlyTimeLeftMinutes'] = $this->BookSpotDirectlyTimeLeftMinutes;
        if (isset($this->SendEmailNotificationQueue)) $o['SendEmailNotificationQueue'] = $this->SendEmailNotificationQueue;
        if (isset($this->SendSMSNotificationQueue)) $o['SendSMSNotificationQueue'] = $this->SendSMSNotificationQueue;
        if (isset($this->SchedulerDisableHorizontalScrolling)) $o['SchedulerDisableHorizontalScrolling'] = $this->SchedulerDisableHorizontalScrolling;
        if (isset($this->BookOnlyOnExistingCustomers)) $o['BookOnlyOnExistingCustomers'] = $this->BookOnlyOnExistingCustomers;
        if (isset($this->AutoGenerateUniquePinCode)) $o['AutoGenerateUniquePinCode'] = $this->AutoGenerateUniquePinCode;
        if (isset($this->WeightedPrices)) $o['WeightedPrices'] = $this->WeightedPrices;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->AutoCreateUserProfile)) $o['AutoCreateUserProfile'] = $this->AutoCreateUserProfile;
        if (isset($this->ShowMultipleResourcesAsOne)) $o['ShowMultipleResourcesAsOne'] = $this->ShowMultipleResourcesAsOne;
        if (isset($this->ShowMultiDayAsTime)) $o['ShowMultiDayAsTime'] = $this->ShowMultiDayAsTime;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class AdminPaymentOptions extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Description='',

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class PaymentProviders extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Description='',

        // @Required()
        /** @var string */
        public string $Category='',

        /** @var string|null */
        public ?string $Url=null,
        // @Required()
        /** @var bool|null */
        public ?bool $Active=null,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Category'])) $this->Category = $o['Category'];
        if (isset($o['Url'])) $this->Url = $o['Url'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Category)) $o['Category'] = $this->Category;
        if (isset($this->Url)) $o['Url'] = $this->Url;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class PaymentSetting extends BaseModel implements JsonSerializable
{
    public function __construct(
        /** @var AdminPaymentOptions|null */
        public ?AdminPaymentOptions $AdminPaymentOption=null,
        // @Ignore()
        /** @var array<AdminPaymentOptions>|null */
        public ?array $AdminPaymentOptions=null,

        // @Ignore()
        /** @var array<PaymentProviders>|null */
        public ?array $PaymentProviderOptions=null,

        // @Required()
        /** @var bool|null */
        public ?bool $Enabled=null,

        // @Required()
        /** @var int */
        public int $InvoiceFee=0,

        // @Required()
        /** @var bool|null */
        public ?bool $AllowCreditCardPayment=null,

        // @Required()
        /** @var bool|null */
        public ?bool $AllowInvoicePayment=null,

        // @Required()
        /** @var bool|null */
        public ?bool $AllowBankPayment=null,

        // @Required()
        /** @var bool|null */
        public ?bool $GuaranteeOffered=null,

        // @Required()
        /** @var bool|null */
        public ?bool $RefundOnCancelBooking=null,

        /** @var int|null */
        public ?int $DefaultPaymentOptionId=null,
        // @Required()
        /** @var int */
        public int $PaymentProviderId=0,

        // @Required()
        /** @var bool|null */
        public ?bool $SendPaymentRequestDirectly=null,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var string */
        public string $Id=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['AdminPaymentOption'])) $this->AdminPaymentOption = JsonConverters::from('AdminPaymentOptions', $o['AdminPaymentOption']);
        if (isset($o['AdminPaymentOptions'])) $this->AdminPaymentOptions = JsonConverters::fromArray('AdminPaymentOptions', $o['AdminPaymentOptions']);
        if (isset($o['PaymentProviderOptions'])) $this->PaymentProviderOptions = JsonConverters::fromArray('PaymentProviders', $o['PaymentProviderOptions']);
        if (isset($o['Enabled'])) $this->Enabled = $o['Enabled'];
        if (isset($o['InvoiceFee'])) $this->InvoiceFee = $o['InvoiceFee'];
        if (isset($o['AllowCreditCardPayment'])) $this->AllowCreditCardPayment = $o['AllowCreditCardPayment'];
        if (isset($o['AllowInvoicePayment'])) $this->AllowInvoicePayment = $o['AllowInvoicePayment'];
        if (isset($o['AllowBankPayment'])) $this->AllowBankPayment = $o['AllowBankPayment'];
        if (isset($o['GuaranteeOffered'])) $this->GuaranteeOffered = $o['GuaranteeOffered'];
        if (isset($o['RefundOnCancelBooking'])) $this->RefundOnCancelBooking = $o['RefundOnCancelBooking'];
        if (isset($o['DefaultPaymentOptionId'])) $this->DefaultPaymentOptionId = $o['DefaultPaymentOptionId'];
        if (isset($o['PaymentProviderId'])) $this->PaymentProviderId = $o['PaymentProviderId'];
        if (isset($o['SendPaymentRequestDirectly'])) $this->SendPaymentRequestDirectly = $o['SendPaymentRequestDirectly'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->AdminPaymentOption)) $o['AdminPaymentOption'] = JsonConverters::to('AdminPaymentOptions', $this->AdminPaymentOption);
        if (isset($this->AdminPaymentOptions)) $o['AdminPaymentOptions'] = JsonConverters::toArray('AdminPaymentOptions', $this->AdminPaymentOptions);
        if (isset($this->PaymentProviderOptions)) $o['PaymentProviderOptions'] = JsonConverters::toArray('PaymentProviders', $this->PaymentProviderOptions);
        if (isset($this->Enabled)) $o['Enabled'] = $this->Enabled;
        if (isset($this->InvoiceFee)) $o['InvoiceFee'] = $this->InvoiceFee;
        if (isset($this->AllowCreditCardPayment)) $o['AllowCreditCardPayment'] = $this->AllowCreditCardPayment;
        if (isset($this->AllowInvoicePayment)) $o['AllowInvoicePayment'] = $this->AllowInvoicePayment;
        if (isset($this->AllowBankPayment)) $o['AllowBankPayment'] = $this->AllowBankPayment;
        if (isset($this->GuaranteeOffered)) $o['GuaranteeOffered'] = $this->GuaranteeOffered;
        if (isset($this->RefundOnCancelBooking)) $o['RefundOnCancelBooking'] = $this->RefundOnCancelBooking;
        if (isset($this->DefaultPaymentOptionId)) $o['DefaultPaymentOptionId'] = $this->DefaultPaymentOptionId;
        if (isset($this->PaymentProviderId)) $o['PaymentProviderId'] = $this->PaymentProviderId;
        if (isset($this->SendPaymentRequestDirectly)) $o['SendPaymentRequestDirectly'] = $this->SendPaymentRequestDirectly;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class CalendarExport extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $CompanyId='',

        // @Required()
        /** @var int */
        public int $BookingId=0,

        // @Required()
        /** @var int */
        public int $ExceptionId=0,

        /** @var bool|null */
        public ?bool $CalendarSync=null,
        /** @var string|null */
        public ?string $CalendarId=null,
        /** @var bool|null */
        public ?bool $IsExceptionDeleted=null,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['BookingId'])) $this->BookingId = $o['BookingId'];
        if (isset($o['ExceptionId'])) $this->ExceptionId = $o['ExceptionId'];
        if (isset($o['CalendarSync'])) $this->CalendarSync = $o['CalendarSync'];
        if (isset($o['CalendarId'])) $this->CalendarId = $o['CalendarId'];
        if (isset($o['IsExceptionDeleted'])) $this->IsExceptionDeleted = $o['IsExceptionDeleted'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->BookingId)) $o['BookingId'] = $this->BookingId;
        if (isset($this->ExceptionId)) $o['ExceptionId'] = $this->ExceptionId;
        if (isset($this->CalendarSync)) $o['CalendarSync'] = $this->CalendarSync;
        if (isset($this->CalendarId)) $o['CalendarId'] = $this->CalendarId;
        if (isset($this->IsExceptionDeleted)) $o['IsExceptionDeleted'] = $this->IsExceptionDeleted;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class BookingLogEventType extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Description='',

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class BookingLog extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @References("typeof(BokaMera.API.ServiceModel.Db.BookingLogEventType)")
        /** @var int */
        public int $EventTypeId=0,

        /** @var BookingLogEventType|null */
        public ?BookingLogEventType $EventType=null,
        // @Required()
        /** @var string */
        public string $CompanyId='',

        // @Required()
        /** @var int */
        public int $BookingId=0,

        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Comments=null,
        /** @var string|null */
        public ?string $UserId=null,
        // @Required()
        /** @var DateTime */
        public DateTime $Created=new DateTime(),

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null
    ) {
    }

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

class PaymentLog extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @References("typeof(BokaMera.API.ServiceModel.Db.Currency)")
        /** @var string|null */
        public ?string $CurrencyId=null,

        /** @var Currency|null */
        public ?Currency $CurrencyInfo=null,
        // @Required()
        /** @var string */
        public string $CompanyId='',

        /** @var int */
        public int $Id=0,
        // @Required()
        /** @var int */
        public int $BookingId=0,

        /** @var string|null */
        public ?string $PaymentReferenceId=null,
        /** @var int|null */
        public ?int $PaymentProviderId=null,
        /** @var string|null */
        public ?string $OrderItemReferenceId=null,
        /** @var float|null */
        public ?float $Amount=null,
        /** @var float|null */
        public ?float $VAT=null,
        /** @var float|null */
        public ?float $AmountCredited=null,
        /** @var string|null */
        public ?string $Comments=null,
        // @Required()
        /** @var DateTime */
        public DateTime $Created=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $Updated=new DateTime(),

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['CurrencyId'])) $this->CurrencyId = $o['CurrencyId'];
        if (isset($o['CurrencyInfo'])) $this->CurrencyInfo = JsonConverters::from('Currency', $o['CurrencyInfo']);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        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['PaymentProviderId'])) $this->PaymentProviderId = $o['PaymentProviderId'];
        if (isset($o['OrderItemReferenceId'])) $this->OrderItemReferenceId = $o['OrderItemReferenceId'];
        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['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']);
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->CurrencyId)) $o['CurrencyId'] = $this->CurrencyId;
        if (isset($this->CurrencyInfo)) $o['CurrencyInfo'] = JsonConverters::to('Currency', $this->CurrencyInfo);
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        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->PaymentProviderId)) $o['PaymentProviderId'] = $this->PaymentProviderId;
        if (isset($this->OrderItemReferenceId)) $o['OrderItemReferenceId'] = $this->OrderItemReferenceId;
        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->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);
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        return empty($o) ? new class(){} : $o;
    }
}

class QvicklyCheckoutResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Number=0,
        /** @var string|null */
        public ?string $Status=null,
        /** @var string|null */
        public ?string $OrderId=null,
        /** @var string|null */
        public ?string $Url=null
    ) {
    }

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

enum Payson2CheckoutStatus : string
{
    case None = 'None';
    case Created = 'Created';
    case FormsFilled = 'FormsFilled';
    case ReadyToPay = 'ReadyToPay';
    case ProcessingPayment = 'ProcessingPayment';
    case ReadyToShip = 'ReadyToShip';
    case Shipped = 'Shipped';
    case PaidToAccount = 'PaidToAccount';
    case Canceled = 'Canceled';
    case Credited = 'Credited';
    case Expired = 'Expired';
    case Denied = 'Denied';
}

enum ItemType : string
{
    case Physical = 'Physical';
    case Service = 'Service';
    case Fee = 'Fee';
    case Discount = 'Discount';
}

class Item implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $ItemId='',
        /** @var float */
        public float $DiscountRate=0.0,
        /** @var string|null */
        public ?string $Ean=null,
        /** @var string|null */
        public ?string $ImageUri=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var float */
        public float $Quantity=0.0,
        /** @var string|null */
        public ?string $Reference=null,
        /** @var float */
        public float $TaxRate=0.0,
        /** @var float */
        public float $TotalPriceExcludingTax=0.0,
        /** @var float */
        public float $TotalPriceIncludingTax=0.0,
        /** @var float */
        public float $TotalTaxAmount=0.0,
        /** @var float */
        public float $CreditedAmount=0.0,
        /** @var ItemType|null */
        public ?ItemType $Type=null,
        /** @var float */
        public float $UnitPrice=0.0,
        /** @var string|null */
        public ?string $Uri=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ItemId'])) $this->ItemId = $o['ItemId'];
        if (isset($o['DiscountRate'])) $this->DiscountRate = $o['DiscountRate'];
        if (isset($o['Ean'])) $this->Ean = $o['Ean'];
        if (isset($o['ImageUri'])) $this->ImageUri = JsonConverters::from('string', $o['ImageUri']);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Quantity'])) $this->Quantity = $o['Quantity'];
        if (isset($o['Reference'])) $this->Reference = $o['Reference'];
        if (isset($o['TaxRate'])) $this->TaxRate = $o['TaxRate'];
        if (isset($o['TotalPriceExcludingTax'])) $this->TotalPriceExcludingTax = $o['TotalPriceExcludingTax'];
        if (isset($o['TotalPriceIncludingTax'])) $this->TotalPriceIncludingTax = $o['TotalPriceIncludingTax'];
        if (isset($o['TotalTaxAmount'])) $this->TotalTaxAmount = $o['TotalTaxAmount'];
        if (isset($o['CreditedAmount'])) $this->CreditedAmount = $o['CreditedAmount'];
        if (isset($o['Type'])) $this->Type = JsonConverters::from('ItemType', $o['Type']);
        if (isset($o['UnitPrice'])) $this->UnitPrice = $o['UnitPrice'];
        if (isset($o['Uri'])) $this->Uri = JsonConverters::from('string', $o['Uri']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ItemId)) $o['ItemId'] = $this->ItemId;
        if (isset($this->DiscountRate)) $o['DiscountRate'] = $this->DiscountRate;
        if (isset($this->Ean)) $o['Ean'] = $this->Ean;
        if (isset($this->ImageUri)) $o['ImageUri'] = JsonConverters::to('string', $this->ImageUri);
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Quantity)) $o['Quantity'] = $this->Quantity;
        if (isset($this->Reference)) $o['Reference'] = $this->Reference;
        if (isset($this->TaxRate)) $o['TaxRate'] = $this->TaxRate;
        if (isset($this->TotalPriceExcludingTax)) $o['TotalPriceExcludingTax'] = $this->TotalPriceExcludingTax;
        if (isset($this->TotalPriceIncludingTax)) $o['TotalPriceIncludingTax'] = $this->TotalPriceIncludingTax;
        if (isset($this->TotalTaxAmount)) $o['TotalTaxAmount'] = $this->TotalTaxAmount;
        if (isset($this->CreditedAmount)) $o['CreditedAmount'] = $this->CreditedAmount;
        if (isset($this->Type)) $o['Type'] = JsonConverters::to('ItemType', $this->Type);
        if (isset($this->UnitPrice)) $o['UnitPrice'] = $this->UnitPrice;
        if (isset($this->Uri)) $o['Uri'] = JsonConverters::to('string', $this->Uri);
        return empty($o) ? new class(){} : $o;
    }
}

class Order implements JsonSerializable
{
    public function __construct(
        /** @var Currency|null */
        public ?Currency $Currency=null,
        /** @var float */
        public float $TotalFeeExcludingTax=0.0,
        /** @var float */
        public float $TotalFeeIncludingTax=0.0,
        /** @var float */
        public float $TotalPriceExcludingTax=0.0,
        /** @var float */
        public float $TotalPriceIncludingTax=0.0,
        /** @var float */
        public float $TotalTaxAmount=0.0,
        /** @var float */
        public float $TotalCreditedAmount=0.0,
        /** @var array<Item>|null */
        public ?array $Items=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Currency'])) $this->Currency = JsonConverters::from('Currency', $o['Currency']);
        if (isset($o['TotalFeeExcludingTax'])) $this->TotalFeeExcludingTax = $o['TotalFeeExcludingTax'];
        if (isset($o['TotalFeeIncludingTax'])) $this->TotalFeeIncludingTax = $o['TotalFeeIncludingTax'];
        if (isset($o['TotalPriceExcludingTax'])) $this->TotalPriceExcludingTax = $o['TotalPriceExcludingTax'];
        if (isset($o['TotalPriceIncludingTax'])) $this->TotalPriceIncludingTax = $o['TotalPriceIncludingTax'];
        if (isset($o['TotalTaxAmount'])) $this->TotalTaxAmount = $o['TotalTaxAmount'];
        if (isset($o['TotalCreditedAmount'])) $this->TotalCreditedAmount = $o['TotalCreditedAmount'];
        if (isset($o['Items'])) $this->Items = JsonConverters::fromArray('Item', $o['Items']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Currency)) $o['Currency'] = JsonConverters::to('Currency', $this->Currency);
        if (isset($this->TotalFeeExcludingTax)) $o['TotalFeeExcludingTax'] = $this->TotalFeeExcludingTax;
        if (isset($this->TotalFeeIncludingTax)) $o['TotalFeeIncludingTax'] = $this->TotalFeeIncludingTax;
        if (isset($this->TotalPriceExcludingTax)) $o['TotalPriceExcludingTax'] = $this->TotalPriceExcludingTax;
        if (isset($this->TotalPriceIncludingTax)) $o['TotalPriceIncludingTax'] = $this->TotalPriceIncludingTax;
        if (isset($this->TotalTaxAmount)) $o['TotalTaxAmount'] = $this->TotalTaxAmount;
        if (isset($this->TotalCreditedAmount)) $o['TotalCreditedAmount'] = $this->TotalCreditedAmount;
        if (isset($this->Items)) $o['Items'] = JsonConverters::toArray('Item', $this->Items);
        return empty($o) ? new class(){} : $o;
    }
}

class Merchant implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $CheckoutUri=null,
        /** @var string|null */
        public ?string $ConfirmationUri=null,
        /** @var string|null */
        public ?string $NotificationUri=null,
        /** @var string|null */
        public ?string $ValidationUri=null,
        /** @var string|null */
        public ?string $TermsUri=null,
        /** @var string|null */
        public ?string $Reference=null,
        /** @var string|null */
        public ?string $PartnerId=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CheckoutUri'])) $this->CheckoutUri = JsonConverters::from('string', $o['CheckoutUri']);
        if (isset($o['ConfirmationUri'])) $this->ConfirmationUri = JsonConverters::from('string', $o['ConfirmationUri']);
        if (isset($o['NotificationUri'])) $this->NotificationUri = JsonConverters::from('string', $o['NotificationUri']);
        if (isset($o['ValidationUri'])) $this->ValidationUri = JsonConverters::from('string', $o['ValidationUri']);
        if (isset($o['TermsUri'])) $this->TermsUri = JsonConverters::from('string', $o['TermsUri']);
        if (isset($o['Reference'])) $this->Reference = $o['Reference'];
        if (isset($o['PartnerId'])) $this->PartnerId = $o['PartnerId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CheckoutUri)) $o['CheckoutUri'] = JsonConverters::to('string', $this->CheckoutUri);
        if (isset($this->ConfirmationUri)) $o['ConfirmationUri'] = JsonConverters::to('string', $this->ConfirmationUri);
        if (isset($this->NotificationUri)) $o['NotificationUri'] = JsonConverters::to('string', $this->NotificationUri);
        if (isset($this->ValidationUri)) $o['ValidationUri'] = JsonConverters::to('string', $this->ValidationUri);
        if (isset($this->TermsUri)) $o['TermsUri'] = JsonConverters::to('string', $this->TermsUri);
        if (isset($this->Reference)) $o['Reference'] = $this->Reference;
        if (isset($this->PartnerId)) $o['PartnerId'] = $this->PartnerId;
        return empty($o) ? new class(){} : $o;
    }
}

enum ColorScheme : string
{
    case White = 'White';
    case Blue = 'Blue';
    case Gray = 'Gray';
    case GrayTextLogos = 'GrayTextLogos';
    case BlueTextLogos = 'BlueTextLogos';
    case WhiteTextLogos = 'WhiteTextLogos';
    case WhiteNoFooter = 'WhiteNoFooter';
    case GrayNoFooter = 'GrayNoFooter';
    case BlueNoFooter = 'BlueNoFooter';
}

class Gui implements JsonSerializable
{
    public function __construct(
        /** @var ColorScheme|null */
        public ?ColorScheme $ColorScheme=null,
        /** @var string|null */
        public ?string $Locale=null,
        /** @var bool|null */
        public ?bool $RequestPhone=null,
        /** @var bool|null */
        public ?bool $PhoneOptional=null
    ) {
    }

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

class History implements JsonSerializable
{
    public function __construct(
        /** @var DateTime|null */
        public ?DateTime $Created=null,
        /** @var DateTime|null */
        public ?DateTime $ReadyToPay=null,
        /** @var DateTime|null */
        public ?DateTime $ReadyToShip=null,
        /** @var DateTime|null */
        public ?DateTime $Shipped=null,
        /** @var DateTime|null */
        public ?DateTime $PaidToAccount=null,
        /** @var DateTime|null */
        public ?DateTime $Canceled=null,
        /** @var DateTime|null */
        public ?DateTime $Expired=null,
        /** @var DateTime|null */
        public ?DateTime $Denied=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['ReadyToPay'])) $this->ReadyToPay = JsonConverters::from('DateTime', $o['ReadyToPay']);
        if (isset($o['ReadyToShip'])) $this->ReadyToShip = JsonConverters::from('DateTime', $o['ReadyToShip']);
        if (isset($o['Shipped'])) $this->Shipped = JsonConverters::from('DateTime', $o['Shipped']);
        if (isset($o['PaidToAccount'])) $this->PaidToAccount = JsonConverters::from('DateTime', $o['PaidToAccount']);
        if (isset($o['Canceled'])) $this->Canceled = JsonConverters::from('DateTime', $o['Canceled']);
        if (isset($o['Expired'])) $this->Expired = JsonConverters::from('DateTime', $o['Expired']);
        if (isset($o['Denied'])) $this->Denied = JsonConverters::from('DateTime', $o['Denied']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->ReadyToPay)) $o['ReadyToPay'] = JsonConverters::to('DateTime', $this->ReadyToPay);
        if (isset($this->ReadyToShip)) $o['ReadyToShip'] = JsonConverters::to('DateTime', $this->ReadyToShip);
        if (isset($this->Shipped)) $o['Shipped'] = JsonConverters::to('DateTime', $this->Shipped);
        if (isset($this->PaidToAccount)) $o['PaidToAccount'] = JsonConverters::to('DateTime', $this->PaidToAccount);
        if (isset($this->Canceled)) $o['Canceled'] = JsonConverters::to('DateTime', $this->Canceled);
        if (isset($this->Expired)) $o['Expired'] = JsonConverters::to('DateTime', $this->Expired);
        if (isset($this->Denied)) $o['Denied'] = JsonConverters::to('DateTime', $this->Denied);
        return empty($o) ? new class(){} : $o;
    }
}

class Payson2CheckoutResponse implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Id='',
        /** @var DateTime|null */
        public ?DateTime $ExpirationTime=null,
        /** @var string|null */
        public ?string $Snippet=null,
        /** @var Payson2CheckoutStatus|null */
        public ?Payson2CheckoutStatus $Status=null,
        /** @var Customer|null */
        public ?Customer $Customer=null,
        /** @var Order|null */
        public ?Order $Order=null,
        /** @var Merchant|null */
        public ?Merchant $Merchant=null,
        /** @var Gui|null */
        public ?Gui $Gui=null,
        /** @var History|null */
        public ?History $History=null,
        /** @var int|null */
        public ?int $PurchaseId=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        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 = JsonConverters::from('Payson2CheckoutStatus', $o['Status']);
        if (isset($o['Customer'])) $this->Customer = JsonConverters::from('Customer', $o['Customer']);
        if (isset($o['Order'])) $this->Order = JsonConverters::from('Order', $o['Order']);
        if (isset($o['Merchant'])) $this->Merchant = JsonConverters::from('Merchant', $o['Merchant']);
        if (isset($o['Gui'])) $this->Gui = JsonConverters::from('Gui', $o['Gui']);
        if (isset($o['History'])) $this->History = JsonConverters::from('History', $o['History']);
        if (isset($o['PurchaseId'])) $this->PurchaseId = $o['PurchaseId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        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'] = JsonConverters::to('Payson2CheckoutStatus', $this->Status);
        if (isset($this->Customer)) $o['Customer'] = JsonConverters::to('Customer', $this->Customer);
        if (isset($this->Order)) $o['Order'] = JsonConverters::to('Order', $this->Order);
        if (isset($this->Merchant)) $o['Merchant'] = JsonConverters::to('Merchant', $this->Merchant);
        if (isset($this->Gui)) $o['Gui'] = JsonConverters::to('Gui', $this->Gui);
        if (isset($this->History)) $o['History'] = JsonConverters::to('History', $this->History);
        if (isset($this->PurchaseId)) $o['PurchaseId'] = $this->PurchaseId;
        return empty($o) ? new class(){} : $o;
    }
}

class PaymentDetails extends BaseModel implements IBaseModelCreated, IBaseModelUpdated, JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var QvicklyCheckoutResponse|null */
        public ?QvicklyCheckoutResponse $QvicklyCheckoutSerialized=null,

        // @Ignore()
        /** @var Payson2CheckoutResponse|null */
        public ?Payson2CheckoutResponse $Payson2CheckoutSerialized=null,

        // @Required()
        /** @var string */
        public string $CompanyId='',

        // @Required()
        /** @var int */
        public int $BookingId=0,

        // @Required()
        /** @var string */
        public string $ExternalResponseData='',

        // @Required()
        /** @var string */
        public string $ExternalResponseReference='',

        // @Required()
        /** @var int */
        public int $PaymentProviderId=0,

        // @Required()
        /** @var bool|null */
        public ?bool $IsPayment=null,

        // @Required()
        /** @var DateTime */
        public DateTime $CreatedDate=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $UpdatedDate=new DateTime(),

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['QvicklyCheckoutSerialized'])) $this->QvicklyCheckoutSerialized = JsonConverters::from('QvicklyCheckoutResponse', $o['QvicklyCheckoutSerialized']);
        if (isset($o['Payson2CheckoutSerialized'])) $this->Payson2CheckoutSerialized = JsonConverters::from('Payson2CheckoutResponse', $o['Payson2CheckoutSerialized']);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['BookingId'])) $this->BookingId = $o['BookingId'];
        if (isset($o['ExternalResponseData'])) $this->ExternalResponseData = $o['ExternalResponseData'];
        if (isset($o['ExternalResponseReference'])) $this->ExternalResponseReference = $o['ExternalResponseReference'];
        if (isset($o['PaymentProviderId'])) $this->PaymentProviderId = $o['PaymentProviderId'];
        if (isset($o['IsPayment'])) $this->IsPayment = $o['IsPayment'];
        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['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->QvicklyCheckoutSerialized)) $o['QvicklyCheckoutSerialized'] = JsonConverters::to('QvicklyCheckoutResponse', $this->QvicklyCheckoutSerialized);
        if (isset($this->Payson2CheckoutSerialized)) $o['Payson2CheckoutSerialized'] = JsonConverters::to('Payson2CheckoutResponse', $this->Payson2CheckoutSerialized);
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->BookingId)) $o['BookingId'] = $this->BookingId;
        if (isset($this->ExternalResponseData)) $o['ExternalResponseData'] = $this->ExternalResponseData;
        if (isset($this->ExternalResponseReference)) $o['ExternalResponseReference'] = $this->ExternalResponseReference;
        if (isset($this->PaymentProviderId)) $o['PaymentProviderId'] = $this->PaymentProviderId;
        if (isset($this->IsPayment)) $o['IsPayment'] = $this->IsPayment;
        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->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        return empty($o) ? new class(){} : $o;
    }
}

class BookingPrice extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @References("typeof(BokaMera.API.ServiceModel.Db.Currency)")
        /** @var string|null */
        public ?string $CurrencyId=null,

        /** @var int|null */
        public ?int $PriceId=null,
        /** @var Currency|null */
        public ?Currency $CurrencyInfo=null,
        // @Ignore()
        /** @var string|null */
        public ?string $PriceText=null,

        // @Ignore()
        /** @var array<AppliedRebateCodes>|null */
        public ?array $AppliedCodes=null,

        // @Ignore()
        /** @var bool|null */
        public ?bool $IsRebate=null,

        // @Required()
        /** @var string */
        public string $CompanyId='',

        // @Required()
        /** @var int */
        public int $BookingId=0,

        // @Required()
        /** @var int */
        public int $Quantity=0,

        /** @var float|null */
        public ?float $Price=null,
        /** @var float|null */
        public ?float $VAT=null,
        /** @var string|null */
        public ?string $Category=null,
        // @Required()
        /** @var DateTime */
        public DateTime $Updated=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $Created=new DateTime(),

        // @Required()
        /** @var bool|null */
        public ?bool $Invoiced=null,

        // @Required()
        /** @var bool|null */
        public ?bool $OccupiesSpot=null,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['CurrencyId'])) $this->CurrencyId = $o['CurrencyId'];
        if (isset($o['PriceId'])) $this->PriceId = $o['PriceId'];
        if (isset($o['CurrencyInfo'])) $this->CurrencyInfo = JsonConverters::from('Currency', $o['CurrencyInfo']);
        if (isset($o['PriceText'])) $this->PriceText = $o['PriceText'];
        if (isset($o['AppliedCodes'])) $this->AppliedCodes = JsonConverters::fromArray('AppliedRebateCodes', $o['AppliedCodes']);
        if (isset($o['IsRebate'])) $this->IsRebate = $o['IsRebate'];
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['BookingId'])) $this->BookingId = $o['BookingId'];
        if (isset($o['Quantity'])) $this->Quantity = $o['Quantity'];
        if (isset($o['Price'])) $this->Price = $o['Price'];
        if (isset($o['VAT'])) $this->VAT = $o['VAT'];
        if (isset($o['Category'])) $this->Category = $o['Category'];
        if (isset($o['Updated'])) $this->Updated = JsonConverters::from('DateTime', $o['Updated']);
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['Invoiced'])) $this->Invoiced = $o['Invoiced'];
        if (isset($o['OccupiesSpot'])) $this->OccupiesSpot = $o['OccupiesSpot'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->CurrencyId)) $o['CurrencyId'] = $this->CurrencyId;
        if (isset($this->PriceId)) $o['PriceId'] = $this->PriceId;
        if (isset($this->CurrencyInfo)) $o['CurrencyInfo'] = JsonConverters::to('Currency', $this->CurrencyInfo);
        if (isset($this->PriceText)) $o['PriceText'] = $this->PriceText;
        if (isset($this->AppliedCodes)) $o['AppliedCodes'] = JsonConverters::toArray('AppliedRebateCodes', $this->AppliedCodes);
        if (isset($this->IsRebate)) $o['IsRebate'] = $this->IsRebate;
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->BookingId)) $o['BookingId'] = $this->BookingId;
        if (isset($this->Quantity)) $o['Quantity'] = $this->Quantity;
        if (isset($this->Price)) $o['Price'] = $this->Price;
        if (isset($this->VAT)) $o['VAT'] = $this->VAT;
        if (isset($this->Category)) $o['Category'] = $this->Category;
        if (isset($this->Updated)) $o['Updated'] = JsonConverters::to('DateTime', $this->Updated);
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->Invoiced)) $o['Invoiced'] = $this->Invoiced;
        if (isset($this->OccupiesSpot)) $o['OccupiesSpot'] = $this->OccupiesSpot;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

enum CompanyStatus : int
{
    case Registered = 1;
    case AwaitingApproval = 2;
    case Approved = 3;
    case Inactive = 4;
    case ClosedDown = 5;
    case NotApproved = 6;
}

class CompanyType extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Description='',

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class CodeLockSystem extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Supplier='',

        /** @var string|null */
        public ?string $LogoType=null,
        // @Required()
        /** @var string */
        public string $Description='',

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Supplier'])) $this->Supplier = $o['Supplier'];
        if (isset($o['LogoType'])) $this->LogoType = $o['LogoType'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Supplier)) $o['Supplier'] = $this->Supplier;
        if (isset($this->LogoType)) $o['LogoType'] = $this->LogoType;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class CodeLockSetting extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var array<CodeLockSystem>|null */
        public ?array $CodeLockSystemOptions=null,

        // @Required()
        /** @var bool|null */
        public ?bool $Active=null,

        // @Required()
        /** @var int */
        public int $CodeLockSystemsId=0,

        // @Required()
        /** @var int */
        public int $ValidBeforeMinutes=0,

        // @Required()
        /** @var int */
        public int $ValidAfterMinutes=0,

        // @Required()
        /** @var bool|null */
        public ?bool $DeleteOldBySchedule=null,

        // @Required()
        /** @var DateTime */
        public DateTime $Created=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $Updated=new DateTime(),

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var bool|null */
        public ?bool $SendEmailNotification=null,

        // @Required()
        /** @var bool|null */
        public ?bool $SendSMSNotification=null,

        // @Required()
        /** @var int */
        public int $EmailNotificationTime=0,

        // @Required()
        /** @var int */
        public int $SMSNotificationTime=0,

        // @Required()
        /** @var string */
        public string $Id=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['CodeLockSystemOptions'])) $this->CodeLockSystemOptions = JsonConverters::fromArray('CodeLockSystem', $o['CodeLockSystemOptions']);
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['CodeLockSystemsId'])) $this->CodeLockSystemsId = $o['CodeLockSystemsId'];
        if (isset($o['ValidBeforeMinutes'])) $this->ValidBeforeMinutes = $o['ValidBeforeMinutes'];
        if (isset($o['ValidAfterMinutes'])) $this->ValidAfterMinutes = $o['ValidAfterMinutes'];
        if (isset($o['DeleteOldBySchedule'])) $this->DeleteOldBySchedule = $o['DeleteOldBySchedule'];
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['Updated'])) $this->Updated = JsonConverters::from('DateTime', $o['Updated']);
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['SendEmailNotification'])) $this->SendEmailNotification = $o['SendEmailNotification'];
        if (isset($o['SendSMSNotification'])) $this->SendSMSNotification = $o['SendSMSNotification'];
        if (isset($o['EmailNotificationTime'])) $this->EmailNotificationTime = $o['EmailNotificationTime'];
        if (isset($o['SMSNotificationTime'])) $this->SMSNotificationTime = $o['SMSNotificationTime'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->CodeLockSystemOptions)) $o['CodeLockSystemOptions'] = JsonConverters::toArray('CodeLockSystem', $this->CodeLockSystemOptions);
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->CodeLockSystemsId)) $o['CodeLockSystemsId'] = $this->CodeLockSystemsId;
        if (isset($this->ValidBeforeMinutes)) $o['ValidBeforeMinutes'] = $this->ValidBeforeMinutes;
        if (isset($this->ValidAfterMinutes)) $o['ValidAfterMinutes'] = $this->ValidAfterMinutes;
        if (isset($this->DeleteOldBySchedule)) $o['DeleteOldBySchedule'] = $this->DeleteOldBySchedule;
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->Updated)) $o['Updated'] = JsonConverters::to('DateTime', $this->Updated);
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->SendEmailNotification)) $o['SendEmailNotification'] = $this->SendEmailNotification;
        if (isset($this->SendSMSNotification)) $o['SendSMSNotification'] = $this->SendSMSNotification;
        if (isset($this->EmailNotificationTime)) $o['EmailNotificationTime'] = $this->EmailNotificationTime;
        if (isset($this->SMSNotificationTime)) $o['SMSNotificationTime'] = $this->SMSNotificationTime;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class LanguageResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Id=null,
        /** @var string|null */
        public ?string $Name=null
    ) {
    }

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

class CompanySetting extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var array<LanguageResponse>|null */
        public ?array $Languages=null,

        // @Required()
        /** @var bool|null */
        public ?bool $Active=null,

        /** @var string|null */
        public ?string $InactiveMessage=null,
        // @Required()
        /** @var bool|null */
        public ?bool $Searchable=null,

        /** @var string|null */
        public ?string $GATrackingId=null,
        /** @var string|null */
        public ?string $FacebookPixelId=null,
        // @Required()
        /** @var bool|null */
        public ?bool $MultiLanguage=null,

        // @Required()
        /** @var bool|null */
        public ?bool $EnableAPITranslation=null,

        // @Required()
        /** @var string */
        public string $DefaultLanguage='',

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var string|null */
        public ?string $GTMTrackingId=null,
        // @Required()
        /** @var bool|null */
        public ?bool $ShowOnMarketPlace=null,

        /** @var string|null */
        public ?string $GoogleAdsConversionId=null,
        /** @var string|null */
        public ?string $LinkedinTagId=null,
        /** @var string|null */
        public ?string $GoogleAdsConversionLabel=null,
        // @Required()
        /** @var string */
        public string $Id=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Languages'])) $this->Languages = JsonConverters::fromArray('LanguageResponse', $o['Languages']);
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['InactiveMessage'])) $this->InactiveMessage = $o['InactiveMessage'];
        if (isset($o['Searchable'])) $this->Searchable = $o['Searchable'];
        if (isset($o['GATrackingId'])) $this->GATrackingId = $o['GATrackingId'];
        if (isset($o['FacebookPixelId'])) $this->FacebookPixelId = $o['FacebookPixelId'];
        if (isset($o['MultiLanguage'])) $this->MultiLanguage = $o['MultiLanguage'];
        if (isset($o['EnableAPITranslation'])) $this->EnableAPITranslation = $o['EnableAPITranslation'];
        if (isset($o['DefaultLanguage'])) $this->DefaultLanguage = $o['DefaultLanguage'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['GTMTrackingId'])) $this->GTMTrackingId = $o['GTMTrackingId'];
        if (isset($o['ShowOnMarketPlace'])) $this->ShowOnMarketPlace = $o['ShowOnMarketPlace'];
        if (isset($o['GoogleAdsConversionId'])) $this->GoogleAdsConversionId = $o['GoogleAdsConversionId'];
        if (isset($o['LinkedinTagId'])) $this->LinkedinTagId = $o['LinkedinTagId'];
        if (isset($o['GoogleAdsConversionLabel'])) $this->GoogleAdsConversionLabel = $o['GoogleAdsConversionLabel'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Languages)) $o['Languages'] = JsonConverters::toArray('LanguageResponse', $this->Languages);
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->InactiveMessage)) $o['InactiveMessage'] = $this->InactiveMessage;
        if (isset($this->Searchable)) $o['Searchable'] = $this->Searchable;
        if (isset($this->GATrackingId)) $o['GATrackingId'] = $this->GATrackingId;
        if (isset($this->FacebookPixelId)) $o['FacebookPixelId'] = $this->FacebookPixelId;
        if (isset($this->MultiLanguage)) $o['MultiLanguage'] = $this->MultiLanguage;
        if (isset($this->EnableAPITranslation)) $o['EnableAPITranslation'] = $this->EnableAPITranslation;
        if (isset($this->DefaultLanguage)) $o['DefaultLanguage'] = $this->DefaultLanguage;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->GTMTrackingId)) $o['GTMTrackingId'] = $this->GTMTrackingId;
        if (isset($this->ShowOnMarketPlace)) $o['ShowOnMarketPlace'] = $this->ShowOnMarketPlace;
        if (isset($this->GoogleAdsConversionId)) $o['GoogleAdsConversionId'] = $this->GoogleAdsConversionId;
        if (isset($this->LinkedinTagId)) $o['LinkedinTagId'] = $this->LinkedinTagId;
        if (isset($this->GoogleAdsConversionLabel)) $o['GoogleAdsConversionLabel'] = $this->GoogleAdsConversionLabel;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class WidgetServiceLayouts extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Description='',

        // @Required()
        /** @var string */
        public string $Code='',

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class WidgetTimeLayouts extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Description='',

        // @Required()
        /** @var string */
        public string $Code='',

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class WidgetBookingLayouts extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Description='',

        // @Required()
        /** @var string */
        public string $Code='',

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class WidgetBookingMethods extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Description='',

        // @Required()
        /** @var string */
        public string $Code='',

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class HomepageWidgetSetting extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var array<WidgetServiceLayouts>|null */
        public ?array $WidgetServiceLayoutOptions=null,

        // @Ignore()
        /** @var array<WidgetTimeLayouts>|null */
        public ?array $WidgetTimeLayoutOptions=null,

        // @Ignore()
        /** @var array<WidgetBookingLayouts>|null */
        public ?array $WidgetBookingLayoutOptions=null,

        // @Ignore()
        /** @var array<WidgetBookingMethods>|null */
        public ?array $WidgetBookingMethodOptions=null,

        // @Required()
        /** @var int */
        public int $ServiceLayoutId=0,

        // @Required()
        /** @var int */
        public int $TimeLayoutId=0,

        // @Required()
        /** @var int */
        public int $BookingLayoutId=0,

        // @Required()
        /** @var string */
        public string $PrimaryColor='',

        // @Required()
        /** @var bool|null */
        public ?bool $ShowServiceImage=null,

        // @Required()
        /** @var bool|null */
        public ?bool $ShowNextAvailableTime=null,

        // @Required()
        /** @var bool|null */
        public ?bool $ShowEndTime=null,

        /** @var string|null */
        public ?string $BookedTimeSlotText=null,
        // @Required()
        /** @var bool|null */
        public ?bool $DarkTheme=null,

        // @Required()
        /** @var bool|null */
        public ?bool $ShowRebateCodeField=null,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var bool|null */
        public ?bool $EnableCreateAccount=null,

        // @Required()
        /** @var bool|null */
        public ?bool $EnableLogin=null,

        // @Required()
        /** @var bool|null */
        public ?bool $EnableDirectBooking=null,

        // @Required()
        /** @var bool|null */
        public ?bool $EnableFacebookLogin=null,

        // @Required()
        /** @var string */
        public string $Id=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['WidgetServiceLayoutOptions'])) $this->WidgetServiceLayoutOptions = JsonConverters::fromArray('WidgetServiceLayouts', $o['WidgetServiceLayoutOptions']);
        if (isset($o['WidgetTimeLayoutOptions'])) $this->WidgetTimeLayoutOptions = JsonConverters::fromArray('WidgetTimeLayouts', $o['WidgetTimeLayoutOptions']);
        if (isset($o['WidgetBookingLayoutOptions'])) $this->WidgetBookingLayoutOptions = JsonConverters::fromArray('WidgetBookingLayouts', $o['WidgetBookingLayoutOptions']);
        if (isset($o['WidgetBookingMethodOptions'])) $this->WidgetBookingMethodOptions = JsonConverters::fromArray('WidgetBookingMethods', $o['WidgetBookingMethodOptions']);
        if (isset($o['ServiceLayoutId'])) $this->ServiceLayoutId = $o['ServiceLayoutId'];
        if (isset($o['TimeLayoutId'])) $this->TimeLayoutId = $o['TimeLayoutId'];
        if (isset($o['BookingLayoutId'])) $this->BookingLayoutId = $o['BookingLayoutId'];
        if (isset($o['PrimaryColor'])) $this->PrimaryColor = $o['PrimaryColor'];
        if (isset($o['ShowServiceImage'])) $this->ShowServiceImage = $o['ShowServiceImage'];
        if (isset($o['ShowNextAvailableTime'])) $this->ShowNextAvailableTime = $o['ShowNextAvailableTime'];
        if (isset($o['ShowEndTime'])) $this->ShowEndTime = $o['ShowEndTime'];
        if (isset($o['BookedTimeSlotText'])) $this->BookedTimeSlotText = $o['BookedTimeSlotText'];
        if (isset($o['DarkTheme'])) $this->DarkTheme = $o['DarkTheme'];
        if (isset($o['ShowRebateCodeField'])) $this->ShowRebateCodeField = $o['ShowRebateCodeField'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['EnableCreateAccount'])) $this->EnableCreateAccount = $o['EnableCreateAccount'];
        if (isset($o['EnableLogin'])) $this->EnableLogin = $o['EnableLogin'];
        if (isset($o['EnableDirectBooking'])) $this->EnableDirectBooking = $o['EnableDirectBooking'];
        if (isset($o['EnableFacebookLogin'])) $this->EnableFacebookLogin = $o['EnableFacebookLogin'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->WidgetServiceLayoutOptions)) $o['WidgetServiceLayoutOptions'] = JsonConverters::toArray('WidgetServiceLayouts', $this->WidgetServiceLayoutOptions);
        if (isset($this->WidgetTimeLayoutOptions)) $o['WidgetTimeLayoutOptions'] = JsonConverters::toArray('WidgetTimeLayouts', $this->WidgetTimeLayoutOptions);
        if (isset($this->WidgetBookingLayoutOptions)) $o['WidgetBookingLayoutOptions'] = JsonConverters::toArray('WidgetBookingLayouts', $this->WidgetBookingLayoutOptions);
        if (isset($this->WidgetBookingMethodOptions)) $o['WidgetBookingMethodOptions'] = JsonConverters::toArray('WidgetBookingMethods', $this->WidgetBookingMethodOptions);
        if (isset($this->ServiceLayoutId)) $o['ServiceLayoutId'] = $this->ServiceLayoutId;
        if (isset($this->TimeLayoutId)) $o['TimeLayoutId'] = $this->TimeLayoutId;
        if (isset($this->BookingLayoutId)) $o['BookingLayoutId'] = $this->BookingLayoutId;
        if (isset($this->PrimaryColor)) $o['PrimaryColor'] = $this->PrimaryColor;
        if (isset($this->ShowServiceImage)) $o['ShowServiceImage'] = $this->ShowServiceImage;
        if (isset($this->ShowNextAvailableTime)) $o['ShowNextAvailableTime'] = $this->ShowNextAvailableTime;
        if (isset($this->ShowEndTime)) $o['ShowEndTime'] = $this->ShowEndTime;
        if (isset($this->BookedTimeSlotText)) $o['BookedTimeSlotText'] = $this->BookedTimeSlotText;
        if (isset($this->DarkTheme)) $o['DarkTheme'] = $this->DarkTheme;
        if (isset($this->ShowRebateCodeField)) $o['ShowRebateCodeField'] = $this->ShowRebateCodeField;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->EnableCreateAccount)) $o['EnableCreateAccount'] = $this->EnableCreateAccount;
        if (isset($this->EnableLogin)) $o['EnableLogin'] = $this->EnableLogin;
        if (isset($this->EnableDirectBooking)) $o['EnableDirectBooking'] = $this->EnableDirectBooking;
        if (isset($this->EnableFacebookLogin)) $o['EnableFacebookLogin'] = $this->EnableFacebookLogin;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class HomepageTemplate extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Description='',

        /** @var string|null */
        public ?string $ImageUrl=null,
        // @Required()
        /** @var bool|null */
        public ?bool $Premium=null,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        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['Premium'])) $this->Premium = $o['Premium'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        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->Premium)) $o['Premium'] = $this->Premium;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class HeroSectionStyle extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        /** @var string|null */
        public ?string $Description=null,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class HomepageSetting extends BaseModel implements ICompany, JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var array<HomepageTemplate>|null */
        public ?array $HomepageTemplateOptions=null,

        // @Ignore()
        /** @var array<HeroSectionStyle>|null */
        public ?array $HomepageHeroSectionStyleOptions=null,

        // @Ignore()
        /** @var string|null */
        public ?string $CompanyId=null,

        /** @var string|null */
        public ?string $WelcomePageHeading=null,
        /** @var string|null */
        public ?string $WelcomePageBody=null,
        /** @var string|null */
        public ?string $AboutUsPageHeading=null,
        /** @var string|null */
        public ?string $AboutUsPageBody=null,
        // @Required()
        /** @var int */
        public int $HomePageTemplateId=0,

        /** @var string|null */
        public ?string $ImageUrl=null,
        // @Required()
        /** @var DateTime */
        public DateTime $Updated=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $Created=new DateTime(),

        /** @var string|null */
        public ?string $HomepageHeading=null,
        // @Required()
        /** @var int */
        public int $HeroSectionStyleId=0,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var bool|null */
        public ?bool $ShowRating=null,

        // @Required()
        /** @var bool|null */
        public ?bool $EnableHomepage=null,

        // @Required()
        /** @var string */
        public string $Id=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['HomepageTemplateOptions'])) $this->HomepageTemplateOptions = JsonConverters::fromArray('HomepageTemplate', $o['HomepageTemplateOptions']);
        if (isset($o['HomepageHeroSectionStyleOptions'])) $this->HomepageHeroSectionStyleOptions = JsonConverters::fromArray('HeroSectionStyle', $o['HomepageHeroSectionStyleOptions']);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['WelcomePageHeading'])) $this->WelcomePageHeading = $o['WelcomePageHeading'];
        if (isset($o['WelcomePageBody'])) $this->WelcomePageBody = $o['WelcomePageBody'];
        if (isset($o['AboutUsPageHeading'])) $this->AboutUsPageHeading = $o['AboutUsPageHeading'];
        if (isset($o['AboutUsPageBody'])) $this->AboutUsPageBody = $o['AboutUsPageBody'];
        if (isset($o['HomePageTemplateId'])) $this->HomePageTemplateId = $o['HomePageTemplateId'];
        if (isset($o['ImageUrl'])) $this->ImageUrl = $o['ImageUrl'];
        if (isset($o['Updated'])) $this->Updated = JsonConverters::from('DateTime', $o['Updated']);
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['HomepageHeading'])) $this->HomepageHeading = $o['HomepageHeading'];
        if (isset($o['HeroSectionStyleId'])) $this->HeroSectionStyleId = $o['HeroSectionStyleId'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['ShowRating'])) $this->ShowRating = $o['ShowRating'];
        if (isset($o['EnableHomepage'])) $this->EnableHomepage = $o['EnableHomepage'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->HomepageTemplateOptions)) $o['HomepageTemplateOptions'] = JsonConverters::toArray('HomepageTemplate', $this->HomepageTemplateOptions);
        if (isset($this->HomepageHeroSectionStyleOptions)) $o['HomepageHeroSectionStyleOptions'] = JsonConverters::toArray('HeroSectionStyle', $this->HomepageHeroSectionStyleOptions);
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->WelcomePageHeading)) $o['WelcomePageHeading'] = $this->WelcomePageHeading;
        if (isset($this->WelcomePageBody)) $o['WelcomePageBody'] = $this->WelcomePageBody;
        if (isset($this->AboutUsPageHeading)) $o['AboutUsPageHeading'] = $this->AboutUsPageHeading;
        if (isset($this->AboutUsPageBody)) $o['AboutUsPageBody'] = $this->AboutUsPageBody;
        if (isset($this->HomePageTemplateId)) $o['HomePageTemplateId'] = $this->HomePageTemplateId;
        if (isset($this->ImageUrl)) $o['ImageUrl'] = $this->ImageUrl;
        if (isset($this->Updated)) $o['Updated'] = JsonConverters::to('DateTime', $this->Updated);
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->HomepageHeading)) $o['HomepageHeading'] = $this->HomepageHeading;
        if (isset($this->HeroSectionStyleId)) $o['HeroSectionStyleId'] = $this->HeroSectionStyleId;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->ShowRating)) $o['ShowRating'] = $this->ShowRating;
        if (isset($this->EnableHomepage)) $o['EnableHomepage'] = $this->EnableHomepage;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class AverageRatingScore implements JsonSerializable
{
    public function __construct(
        /** @var float */
        public float $AverageScore=0.0,
        /** @var int */
        public int $Score1Count=0,
        /** @var int */
        public int $Score2Count=0,
        /** @var int */
        public int $Score3Count=0,
        /** @var int */
        public int $Score4Count=0,
        /** @var int */
        public int $Score5Count=0,
        /** @var int */
        public int $Count=0
    ) {
    }

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

class Review extends BaseModel implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $ReviewId='',
        // @Required()
        /** @var string */
        public string $CompanyId='',

        // @Required()
        /** @var string */
        public string $Title='',

        // @Required()
        /** @var string */
        public string $Description='',

        // @Required()
        /** @var string */
        public string $Author='',

        // @Required()
        /** @var int */
        public int $Status=0,

        // @Required()
        /** @var DateTime */
        public DateTime $Created=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $Updated=new DateTime(),

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var string|null */
        public ?string $ReviewAnswer=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['ReviewId'])) $this->ReviewId = $o['ReviewId'];
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Title'])) $this->Title = $o['Title'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Author'])) $this->Author = $o['Author'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['Updated'])) $this->Updated = JsonConverters::from('DateTime', $o['Updated']);
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['ReviewAnswer'])) $this->ReviewAnswer = $o['ReviewAnswer'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->ReviewId)) $o['ReviewId'] = $this->ReviewId;
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Title)) $o['Title'] = $this->Title;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Author)) $o['Author'] = $this->Author;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->Updated)) $o['Updated'] = JsonConverters::to('DateTime', $this->Updated);
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->ReviewAnswer)) $o['ReviewAnswer'] = $this->ReviewAnswer;
        return empty($o) ? new class(){} : $o;
    }
}

class Rating extends BaseModel implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $ReviewId=null,
        /** @var Review|null */
        public ?Review $Review=null,
        // @Required()
        /** @var string */
        public string $CompanyId='',

        // @Required()
        /** @var int */
        public int $BookingId=0,

        // @Required()
        /** @var int */
        public int $RatingScore=0,

        // @Required()
        /** @var int */
        public int $Status=0,

        // @Required()
        /** @var DateTime */
        public DateTime $Created=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $Updated=new DateTime(),

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['ReviewId'])) $this->ReviewId = $o['ReviewId'];
        if (isset($o['Review'])) $this->Review = JsonConverters::from('Review', $o['Review']);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['BookingId'])) $this->BookingId = $o['BookingId'];
        if (isset($o['RatingScore'])) $this->RatingScore = $o['RatingScore'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['Updated'])) $this->Updated = JsonConverters::from('DateTime', $o['Updated']);
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->ReviewId)) $o['ReviewId'] = $this->ReviewId;
        if (isset($this->Review)) $o['Review'] = JsonConverters::to('Review', $this->Review);
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->BookingId)) $o['BookingId'] = $this->BookingId;
        if (isset($this->RatingScore)) $o['RatingScore'] = $this->RatingScore;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->Updated)) $o['Updated'] = JsonConverters::to('DateTime', $this->Updated);
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        return empty($o) ? new class(){} : $o;
    }
}

class LicenseTypeItem extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var string|null */
        public ?string $Name=null,

        // @Required()
        /** @var int */
        public int $LicenseTypesId=0,

        // @Required()
        /** @var int */
        public int $LicenseItemsId=0,

        // @Required()
        /** @var int */
        public int $NumberOfItems=0,

        /** @var int */
        public int $Id=0,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['LicenseTypesId'])) $this->LicenseTypesId = $o['LicenseTypesId'];
        if (isset($o['LicenseItemsId'])) $this->LicenseItemsId = $o['LicenseItemsId'];
        if (isset($o['NumberOfItems'])) $this->NumberOfItems = $o['NumberOfItems'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->LicenseTypesId)) $o['LicenseTypesId'] = $this->LicenseTypesId;
        if (isset($this->LicenseItemsId)) $o['LicenseItemsId'] = $this->LicenseItemsId;
        if (isset($this->NumberOfItems)) $o['NumberOfItems'] = $this->NumberOfItems;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        return empty($o) ? new class(){} : $o;
    }
}

class Country extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @References("typeof(BokaMera.API.ServiceModel.Db.Currency)")
        /** @var string|null */
        public ?string $CurrencyId=null,

        /** @var Currency|null */
        public ?Currency $CurrencyInfo=null,
        // @Required()
        /** @var string */
        public string $Name='',

        /** @var string|null */
        public ?string $Culture=null,
        /** @var string|null */
        public ?string $TimeZone=null,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var string */
        public string $Id=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['CurrencyId'])) $this->CurrencyId = $o['CurrencyId'];
        if (isset($o['CurrencyInfo'])) $this->CurrencyInfo = JsonConverters::from('Currency', $o['CurrencyInfo']);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Culture'])) $this->Culture = $o['Culture'];
        if (isset($o['TimeZone'])) $this->TimeZone = $o['TimeZone'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->CurrencyId)) $o['CurrencyId'] = $this->CurrencyId;
        if (isset($this->CurrencyInfo)) $o['CurrencyInfo'] = JsonConverters::to('Currency', $this->CurrencyInfo);
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Culture)) $o['Culture'] = $this->Culture;
        if (isset($this->TimeZone)) $o['TimeZone'] = $this->TimeZone;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class LicensePrice extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var Country|null */
        public ?Country $Country=null,

        // @Ignore()
        /** @var bool|null */
        public ?bool $MonthlyPayment=null,

        // @Required()
        /** @var int */
        public int $LicenseTypeId=0,

        // @Required()
        /** @var string */
        public string $CountryId='',

        // @Required()
        /** @var int */
        public int $Price=0,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Country'])) $this->Country = JsonConverters::from('Country', $o['Country']);
        if (isset($o['MonthlyPayment'])) $this->MonthlyPayment = $o['MonthlyPayment'];
        if (isset($o['LicenseTypeId'])) $this->LicenseTypeId = $o['LicenseTypeId'];
        if (isset($o['CountryId'])) $this->CountryId = $o['CountryId'];
        if (isset($o['Price'])) $this->Price = $o['Price'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Country)) $o['Country'] = JsonConverters::to('Country', $this->Country);
        if (isset($this->MonthlyPayment)) $o['MonthlyPayment'] = $this->MonthlyPayment;
        if (isset($this->LicenseTypeId)) $o['LicenseTypeId'] = $this->LicenseTypeId;
        if (isset($this->CountryId)) $o['CountryId'] = $this->CountryId;
        if (isset($this->Price)) $o['Price'] = $this->Price;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        return empty($o) ? new class(){} : $o;
    }
}

class LicenseType extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var array<LicenseTypeItem>|null */
        public ?array $LicenseItems=null,

        // @Ignore()
        /** @var array<LicensePrice>|null */
        public ?array $Prices=null,

        // @Ignore()
        /** @var int */
        public int $PeriodOfNoticeDays=0,

        // @Ignore()
        /** @var LicenseType|null */
        public ?LicenseType $NextLicenseOption=null,

        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Description='',

        // @Required()
        /** @var bool|null */
        public ?bool $ExtraLicenseOption=null,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['LicenseItems'])) $this->LicenseItems = JsonConverters::fromArray('LicenseTypeItem', $o['LicenseItems']);
        if (isset($o['Prices'])) $this->Prices = JsonConverters::fromArray('LicensePrice', $o['Prices']);
        if (isset($o['PeriodOfNoticeDays'])) $this->PeriodOfNoticeDays = $o['PeriodOfNoticeDays'];
        if (isset($o['NextLicenseOption'])) $this->NextLicenseOption = JsonConverters::from('LicenseType', $o['NextLicenseOption']);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ExtraLicenseOption'])) $this->ExtraLicenseOption = $o['ExtraLicenseOption'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->LicenseItems)) $o['LicenseItems'] = JsonConverters::toArray('LicenseTypeItem', $this->LicenseItems);
        if (isset($this->Prices)) $o['Prices'] = JsonConverters::toArray('LicensePrice', $this->Prices);
        if (isset($this->PeriodOfNoticeDays)) $o['PeriodOfNoticeDays'] = $this->PeriodOfNoticeDays;
        if (isset($this->NextLicenseOption)) $o['NextLicenseOption'] = JsonConverters::to('LicenseType', $this->NextLicenseOption);
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ExtraLicenseOption)) $o['ExtraLicenseOption'] = $this->ExtraLicenseOption;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class License extends BaseModel implements JsonSerializable
{
    public function __construct(
        /** @var LicenseType|null */
        public ?LicenseType $Type=null,
        // @Required()
        /** @var string */
        public string $CompanyId='',

        /** @var int */
        public int $Id=0,
        // @Required()
        /** @var int */
        public int $TypeId=0,

        // @Required()
        /** @var DateTime */
        public DateTime $ValidFrom=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $ValidTo=new DateTime(),

        // @Required()
        /** @var bool|null */
        public ?bool $Active=null,

        // @Required()
        /** @var DateTime */
        public DateTime $Updated=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $Created=new DateTime(),

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var string|null */
        public ?string $MetaData=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Type'])) $this->Type = JsonConverters::from('LicenseType', $o['Type']);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['TypeId'])) $this->TypeId = $o['TypeId'];
        if (isset($o['ValidFrom'])) $this->ValidFrom = JsonConverters::from('DateTime', $o['ValidFrom']);
        if (isset($o['ValidTo'])) $this->ValidTo = JsonConverters::from('DateTime', $o['ValidTo']);
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['Updated'])) $this->Updated = JsonConverters::from('DateTime', $o['Updated']);
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['MetaData'])) $this->MetaData = $o['MetaData'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Type)) $o['Type'] = JsonConverters::to('LicenseType', $this->Type);
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->TypeId)) $o['TypeId'] = $this->TypeId;
        if (isset($this->ValidFrom)) $o['ValidFrom'] = JsonConverters::to('DateTime', $this->ValidFrom);
        if (isset($this->ValidTo)) $o['ValidTo'] = JsonConverters::to('DateTime', $this->ValidTo);
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->Updated)) $o['Updated'] = JsonConverters::to('DateTime', $this->Updated);
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->MetaData)) $o['MetaData'] = $this->MetaData;
        return empty($o) ? new class(){} : $o;
    }
}

class CompanyCategory extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Header='',

        // @Required()
        /** @var string */
        public string $Description='',

        /** @var string|null */
        public ?string $ImageUrl=null,
        // @Required()
        /** @var bool|null */
        public ?bool $Active=null,

        /** @var int|null */
        public ?int $SortOrder=null,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Header'])) $this->Header = $o['Header'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ImageUrl'])) $this->ImageUrl = JsonConverters::from('string', $o['ImageUrl']);
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['SortOrder'])) $this->SortOrder = $o['SortOrder'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Header)) $o['Header'] = $this->Header;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ImageUrl)) $o['ImageUrl'] = JsonConverters::to('string', $this->ImageUrl);
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->SortOrder)) $o['SortOrder'] = $this->SortOrder;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class Company extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var CompanyStatus|null */
        public ?CompanyStatus $Status=null,

        // @Ignore()
        /** @var bool|null */
        public ?bool $Active=null,

        // @Ignore()
        /** @var array<CustomFieldConfig>|null */
        public ?array $CustomerCustomFieldsConfig=null,

        // @Ignore()
        /** @var string|null */
        public ?string $BookingAgreements=null,

        // @Ignore()
        /** @var BookingSettings|null */
        public ?BookingSettings $BookingSettings=null,

        // @Ignore()
        /** @var CompanyType|null */
        public ?CompanyType $CompanyType=null,

        // @Ignore()
        /** @var CodeLockSetting|null */
        public ?CodeLockSetting $CodeLockSettings=null,

        // @Ignore()
        /** @var PaymentSetting|null */
        public ?PaymentSetting $PaymentSettings=null,

        // @Ignore()
        /** @var CompanySetting|null */
        public ?CompanySetting $Settings=null,

        // @Ignore()
        /** @var HomepageWidgetSetting|null */
        public ?HomepageWidgetSetting $WidgetSettings=null,

        // @Ignore()
        /** @var HomepageSetting|null */
        public ?HomepageSetting $HomepageSettings=null,

        // @Ignore()
        /** @var AverageRatingScore|null */
        public ?AverageRatingScore $RatingScore=null,

        // @Ignore()
        /** @var array<Rating>|null */
        public ?array $Ratings=null,

        // @Ignore()
        /** @var float|null */
        public ?float $Distance=null,

        // @Ignore()
        /** @var array<License>|null */
        public ?array $Licenses=null,

        // @Ignore()
        /** @var array<License>|null */
        public ?array $ActiveLicenses=null,

        // @Ignore()
        /** @var License|null */
        public ?License $CurrentLicense=null,

        // @Ignore()
        /** @var bool|null */
        public ?bool $IsFreeAccount=null,

        // @Ignore()
        /** @var CultureInfo|null */
        public ?CultureInfo $DefaultLanguage=null,

        /** @var CompanyCategory|null */
        public ?CompanyCategory $Category=null,
        // @Ignore()
        /** @var float */
        public float $Lat=0.0,

        // @Ignore()
        /** @var float */
        public float $Lon=0.0,

        // @Ignore()
        /** @var bool|null */
        public ?bool $IsFavorite=null,

        // @Ignore()
        /** @var array<ExternalReference>|null */
        public ?array $ExternalReferences=null,

        // @Required()
        /** @var string */
        public string $OrganisationNumber='',

        // @Required()
        /** @var int */
        public int $StatusId=0,

        // @Required()
        /** @var int */
        public int $CategoryId=0,

        // @Required()
        /** @var string */
        public string $SitePath='',

        // @Required()
        /** @var string */
        public string $Name='',

        /** @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 $OpeningHours=null,
        /** @var string|null */
        public ?string $FaxNumber=null,
        // @Required()
        /** @var string */
        public string $Email='',

        /** @var string|null */
        public ?string $Phone=null,
        /** @var string|null */
        public ?string $Details=null,
        /** @var string|null */
        public ?string $LogoType=null,
        // @Required()
        /** @var bool|null */
        public ?bool $ApprovedByAdmin=null,

        // @Required()
        /** @var DateTime */
        public DateTime $Updated=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $Created=new DateTime(),

        /** @var string|null */
        public ?string $IpAddress=null,
        /** @var string|null */
        public ?string $Homepage=null,
        /** @var string|null */
        public ?string $DomainName=null,
        // @Required()
        /** @var string */
        public string $CountryId='',

        // @Required()
        /** @var int */
        public int $CompanyOwnerId=0,

        /** @var int|null */
        public ?int $TypeId=null,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var string */
        public string $Id=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Status'])) $this->Status = JsonConverters::from('CompanyStatus', $o['Status']);
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['CustomerCustomFieldsConfig'])) $this->CustomerCustomFieldsConfig = JsonConverters::fromArray('CustomFieldConfig', $o['CustomerCustomFieldsConfig']);
        if (isset($o['BookingAgreements'])) $this->BookingAgreements = $o['BookingAgreements'];
        if (isset($o['BookingSettings'])) $this->BookingSettings = JsonConverters::from('BookingSettings', $o['BookingSettings']);
        if (isset($o['CompanyType'])) $this->CompanyType = JsonConverters::from('CompanyType', $o['CompanyType']);
        if (isset($o['CodeLockSettings'])) $this->CodeLockSettings = JsonConverters::from('CodeLockSetting', $o['CodeLockSettings']);
        if (isset($o['PaymentSettings'])) $this->PaymentSettings = JsonConverters::from('PaymentSetting', $o['PaymentSettings']);
        if (isset($o['Settings'])) $this->Settings = JsonConverters::from('CompanySetting', $o['Settings']);
        if (isset($o['WidgetSettings'])) $this->WidgetSettings = JsonConverters::from('HomepageWidgetSetting', $o['WidgetSettings']);
        if (isset($o['HomepageSettings'])) $this->HomepageSettings = JsonConverters::from('HomepageSetting', $o['HomepageSettings']);
        if (isset($o['RatingScore'])) $this->RatingScore = JsonConverters::from('AverageRatingScore', $o['RatingScore']);
        if (isset($o['Ratings'])) $this->Ratings = JsonConverters::fromArray('Rating', $o['Ratings']);
        if (isset($o['Distance'])) $this->Distance = $o['Distance'];
        if (isset($o['Licenses'])) $this->Licenses = JsonConverters::fromArray('License', $o['Licenses']);
        if (isset($o['ActiveLicenses'])) $this->ActiveLicenses = JsonConverters::fromArray('License', $o['ActiveLicenses']);
        if (isset($o['CurrentLicense'])) $this->CurrentLicense = JsonConverters::from('License', $o['CurrentLicense']);
        if (isset($o['IsFreeAccount'])) $this->IsFreeAccount = $o['IsFreeAccount'];
        if (isset($o['DefaultLanguage'])) $this->DefaultLanguage = JsonConverters::from('CultureInfo', $o['DefaultLanguage']);
        if (isset($o['Category'])) $this->Category = JsonConverters::from('CompanyCategory', $o['Category']);
        if (isset($o['Lat'])) $this->Lat = $o['Lat'];
        if (isset($o['Lon'])) $this->Lon = $o['Lon'];
        if (isset($o['IsFavorite'])) $this->IsFavorite = $o['IsFavorite'];
        if (isset($o['ExternalReferences'])) $this->ExternalReferences = JsonConverters::fromArray('ExternalReference', $o['ExternalReferences']);
        if (isset($o['OrganisationNumber'])) $this->OrganisationNumber = $o['OrganisationNumber'];
        if (isset($o['StatusId'])) $this->StatusId = $o['StatusId'];
        if (isset($o['CategoryId'])) $this->CategoryId = $o['CategoryId'];
        if (isset($o['SitePath'])) $this->SitePath = $o['SitePath'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        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['OpeningHours'])) $this->OpeningHours = $o['OpeningHours'];
        if (isset($o['FaxNumber'])) $this->FaxNumber = $o['FaxNumber'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['Details'])) $this->Details = $o['Details'];
        if (isset($o['LogoType'])) $this->LogoType = $o['LogoType'];
        if (isset($o['ApprovedByAdmin'])) $this->ApprovedByAdmin = $o['ApprovedByAdmin'];
        if (isset($o['Updated'])) $this->Updated = JsonConverters::from('DateTime', $o['Updated']);
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['IpAddress'])) $this->IpAddress = $o['IpAddress'];
        if (isset($o['Homepage'])) $this->Homepage = $o['Homepage'];
        if (isset($o['DomainName'])) $this->DomainName = $o['DomainName'];
        if (isset($o['CountryId'])) $this->CountryId = $o['CountryId'];
        if (isset($o['CompanyOwnerId'])) $this->CompanyOwnerId = $o['CompanyOwnerId'];
        if (isset($o['TypeId'])) $this->TypeId = $o['TypeId'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Status)) $o['Status'] = JsonConverters::to('CompanyStatus', $this->Status);
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->CustomerCustomFieldsConfig)) $o['CustomerCustomFieldsConfig'] = JsonConverters::toArray('CustomFieldConfig', $this->CustomerCustomFieldsConfig);
        if (isset($this->BookingAgreements)) $o['BookingAgreements'] = $this->BookingAgreements;
        if (isset($this->BookingSettings)) $o['BookingSettings'] = JsonConverters::to('BookingSettings', $this->BookingSettings);
        if (isset($this->CompanyType)) $o['CompanyType'] = JsonConverters::to('CompanyType', $this->CompanyType);
        if (isset($this->CodeLockSettings)) $o['CodeLockSettings'] = JsonConverters::to('CodeLockSetting', $this->CodeLockSettings);
        if (isset($this->PaymentSettings)) $o['PaymentSettings'] = JsonConverters::to('PaymentSetting', $this->PaymentSettings);
        if (isset($this->Settings)) $o['Settings'] = JsonConverters::to('CompanySetting', $this->Settings);
        if (isset($this->WidgetSettings)) $o['WidgetSettings'] = JsonConverters::to('HomepageWidgetSetting', $this->WidgetSettings);
        if (isset($this->HomepageSettings)) $o['HomepageSettings'] = JsonConverters::to('HomepageSetting', $this->HomepageSettings);
        if (isset($this->RatingScore)) $o['RatingScore'] = JsonConverters::to('AverageRatingScore', $this->RatingScore);
        if (isset($this->Ratings)) $o['Ratings'] = JsonConverters::toArray('Rating', $this->Ratings);
        if (isset($this->Distance)) $o['Distance'] = $this->Distance;
        if (isset($this->Licenses)) $o['Licenses'] = JsonConverters::toArray('License', $this->Licenses);
        if (isset($this->ActiveLicenses)) $o['ActiveLicenses'] = JsonConverters::toArray('License', $this->ActiveLicenses);
        if (isset($this->CurrentLicense)) $o['CurrentLicense'] = JsonConverters::to('License', $this->CurrentLicense);
        if (isset($this->IsFreeAccount)) $o['IsFreeAccount'] = $this->IsFreeAccount;
        if (isset($this->DefaultLanguage)) $o['DefaultLanguage'] = JsonConverters::to('CultureInfo', $this->DefaultLanguage);
        if (isset($this->Category)) $o['Category'] = JsonConverters::to('CompanyCategory', $this->Category);
        if (isset($this->Lat)) $o['Lat'] = $this->Lat;
        if (isset($this->Lon)) $o['Lon'] = $this->Lon;
        if (isset($this->IsFavorite)) $o['IsFavorite'] = $this->IsFavorite;
        if (isset($this->ExternalReferences)) $o['ExternalReferences'] = JsonConverters::toArray('ExternalReference', $this->ExternalReferences);
        if (isset($this->OrganisationNumber)) $o['OrganisationNumber'] = $this->OrganisationNumber;
        if (isset($this->StatusId)) $o['StatusId'] = $this->StatusId;
        if (isset($this->CategoryId)) $o['CategoryId'] = $this->CategoryId;
        if (isset($this->SitePath)) $o['SitePath'] = $this->SitePath;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        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->OpeningHours)) $o['OpeningHours'] = $this->OpeningHours;
        if (isset($this->FaxNumber)) $o['FaxNumber'] = $this->FaxNumber;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->Details)) $o['Details'] = $this->Details;
        if (isset($this->LogoType)) $o['LogoType'] = $this->LogoType;
        if (isset($this->ApprovedByAdmin)) $o['ApprovedByAdmin'] = $this->ApprovedByAdmin;
        if (isset($this->Updated)) $o['Updated'] = JsonConverters::to('DateTime', $this->Updated);
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->IpAddress)) $o['IpAddress'] = $this->IpAddress;
        if (isset($this->Homepage)) $o['Homepage'] = $this->Homepage;
        if (isset($this->DomainName)) $o['DomainName'] = $this->DomainName;
        if (isset($this->CountryId)) $o['CountryId'] = $this->CountryId;
        if (isset($this->CompanyOwnerId)) $o['CompanyOwnerId'] = $this->CompanyOwnerId;
        if (isset($this->TypeId)) $o['TypeId'] = $this->TypeId;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class BookingStatus extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Description='',

        // @Required()
        /** @var string */
        public string $Color='',

        // @Required()
        /** @var string */
        public string $Icon='',

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var int */
        public int $Id=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Color'])) $this->Color = $o['Color'];
        if (isset($o['Icon'])) $this->Icon = $o['Icon'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Color)) $o['Color'] = $this->Color;
        if (isset($this->Icon)) $o['Icon'] = $this->Icon;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        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 Booking extends BaseModel implements IInterval, ICustomFieldTable, IBaseModelUpdated, IBaseModelCreated, JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var Customer|null */
        public ?Customer $Customer=null,

        // @Ignore()
        /** @var Service|null */
        public ?Service $Service=null,

        // @Ignore()
        /** @var CalendarExport|null */
        public ?CalendarExport $CalendarExport=null,

        // @Ignore()
        /** @var array<BookingLog>|null */
        public ?array $Log=null,

        // @Ignore()
        /** @var array<PaymentLog>|null */
        public ?array $PaymentLog=null,

        // @Ignore()
        /** @var array<PaymentDetails>|null */
        public ?array $CheckoutLogs=null,

        // @Ignore()
        /** @var array<BookingPrice>|null */
        public ?array $Prices=null,

        // @Ignore()
        /** @var BookingStatusEnum|null */
        public ?BookingStatusEnum $Status=null,

        // @Ignore()
        /** @var bool|null */
        public ?bool $isReserved=null,

        // @Ignore()
        /** @var string|null */
        public ?string $StatusName=null,

        // @Ignore()
        /** @var Company|null */
        public ?Company $Company=null,

        // @References("typeof(BokaMera.API.ServiceModel.Db.Currency)")
        /** @var string|null */
        public ?string $CurrencyId=null,

        /** @var Currency|null */
        public ?Currency $CurrencyInfo=null,
        /** @var BookingStatus|null */
        public ?BookingStatus $BookingStatus=null,
        // @Ignore()
        /** @var float|null */
        public ?float $TotalPrice=null,

        // @Ignore()
        /** @var int|null */
        public ?int $TotalSpots=null,

        // @Ignore()
        /** @var array<Resource>|null */
        public ?array $Resources=null,

        // @Ignore()
        /** @var array<ExternalReference>|null */
        public ?array $ExternalReferences=null,

        // @Ignore()
        /** @var array<BookedResourceType>|null */
        public ?array $BookedResources=null,

        // @Ignore()
        /** @var array<CustomFieldConfig>|null */
        public ?array $CustomFieldsConfig=null,

        // @Ignore()
        /** @var array<CustomFieldDataResponse>|null */
        public ?array $CustomFieldsData=null,

        // @Ignore()
        /** @var bool|null */
        public ?bool $Active=null,

        // @Ignore()
        /** @var DateTime|null */
        public ?DateTime $LastTimeToUnBook=null,

        // @Ignore()
        /** @var array<PriceMapping>|null */
        public ?array $PriceMappings=null,

        // @Required()
        /** @var DateTime */
        public DateTime $UpdatedDate=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $CreatedDate=new DateTime(),

        // @Required()
        /** @var string */
        public string $CompanyId='',

        /** @var int */
        public int $Id=0,
        // @Required()
        /** @var string */
        public string $CustomerId='',

        // @Required()
        /** @var int */
        public int $ServiceId=0,

        // @Required()
        /** @var int */
        public int $StatusId=0,

        /** @var DateTime|null */
        public ?DateTime $UnbookedOn=null,
        /** @var string|null */
        public ?string $UnbookedComments=null,
        /** @var string|null */
        public ?string $BookedComments=null,
        // @Required()
        /** @var string */
        public string $BookedBy='',

        /** @var string|null */
        public ?string $UnBookedBy=null,
        // @Required()
        /** @var bool|null */
        public ?bool $SendSmsReminder=null,

        // @Required()
        /** @var bool|null */
        public ?bool $SendEmailReminder=null,

        // @Required()
        /** @var bool|null */
        public ?bool $SendSmsConfirmation=null,

        /** @var string|null */
        public ?string $RebateCode=null,
        /** @var string|null */
        public ?string $Comments=null,
        /** @var string|null */
        public ?string $IpAddress=null,
        // @Required()
        /** @var int */
        public int $NumberOfBookedSpots=0,

        /** @var string|null */
        public ?string $CommentsToCustomer=null,
        /** @var DateTime|null */
        public ?DateTime $PaymentExpiration=null,
        /** @var float|null */
        public ?float $PriceVat=null,
        // @Required()
        /** @var bool|null */
        public ?bool $SendEmailConfirmation=null,

        /** @var string|null */
        public ?string $CancellationCode=null,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var string|null */
        public ?string $RatingCode=null,
        /** @var string|null */
        public ?string $TextField1=null,
        /** @var string|null */
        public ?string $TextField2=null,
        /** @var string|null */
        public ?string $TextField3=null,
        /** @var string|null */
        public ?string $TextField4=null,
        /** @var string|null */
        public ?string $TextField5=null,
        /** @var string|null */
        public ?string $TextField6=null,
        /** @var string|null */
        public ?string $TextField7=null,
        /** @var string|null */
        public ?string $TextField8=null,
        /** @var string|null */
        public ?string $TextField9=null,
        /** @var string|null */
        public ?string $TextField10=null,
        /** @var string|null */
        public ?string $TextField11=null,
        /** @var string|null */
        public ?string $TextField12=null,
        /** @var string|null */
        public ?string $TextField13=null,
        /** @var string|null */
        public ?string $TextField14=null,
        /** @var string|null */
        public ?string $TextField15=null,
        /** @var string|null */
        public ?string $TextField16=null,
        /** @var string|null */
        public ?string $TextField17=null,
        /** @var string|null */
        public ?string $TextField18=null,
        /** @var string|null */
        public ?string $TextField19=null,
        /** @var string|null */
        public ?string $TextField20=null,
        // @Required()
        /** @var DateTime */
        public DateTime $From=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $To=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Customer'])) $this->Customer = JsonConverters::from('Customer', $o['Customer']);
        if (isset($o['Service'])) $this->Service = JsonConverters::from('Service', $o['Service']);
        if (isset($o['CalendarExport'])) $this->CalendarExport = JsonConverters::from('CalendarExport', $o['CalendarExport']);
        if (isset($o['Log'])) $this->Log = JsonConverters::fromArray('BookingLog', $o['Log']);
        if (isset($o['PaymentLog'])) $this->PaymentLog = JsonConverters::fromArray('PaymentLog', $o['PaymentLog']);
        if (isset($o['CheckoutLogs'])) $this->CheckoutLogs = JsonConverters::fromArray('PaymentDetails', $o['CheckoutLogs']);
        if (isset($o['Prices'])) $this->Prices = JsonConverters::fromArray('BookingPrice', $o['Prices']);
        if (isset($o['Status'])) $this->Status = JsonConverters::from('BookingStatusEnum', $o['Status']);
        if (isset($o['isReserved'])) $this->isReserved = $o['isReserved'];
        if (isset($o['StatusName'])) $this->StatusName = $o['StatusName'];
        if (isset($o['Company'])) $this->Company = JsonConverters::from('Company', $o['Company']);
        if (isset($o['CurrencyId'])) $this->CurrencyId = $o['CurrencyId'];
        if (isset($o['CurrencyInfo'])) $this->CurrencyInfo = JsonConverters::from('Currency', $o['CurrencyInfo']);
        if (isset($o['BookingStatus'])) $this->BookingStatus = JsonConverters::from('BookingStatus', $o['BookingStatus']);
        if (isset($o['TotalPrice'])) $this->TotalPrice = $o['TotalPrice'];
        if (isset($o['TotalSpots'])) $this->TotalSpots = $o['TotalSpots'];
        if (isset($o['Resources'])) $this->Resources = JsonConverters::fromArray('Resource', $o['Resources']);
        if (isset($o['ExternalReferences'])) $this->ExternalReferences = JsonConverters::fromArray('ExternalReference', $o['ExternalReferences']);
        if (isset($o['BookedResources'])) $this->BookedResources = JsonConverters::fromArray('BookedResourceType', $o['BookedResources']);
        if (isset($o['CustomFieldsConfig'])) $this->CustomFieldsConfig = JsonConverters::fromArray('CustomFieldConfig', $o['CustomFieldsConfig']);
        if (isset($o['CustomFieldsData'])) $this->CustomFieldsData = JsonConverters::fromArray('CustomFieldDataResponse', $o['CustomFieldsData']);
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['LastTimeToUnBook'])) $this->LastTimeToUnBook = JsonConverters::from('DateTime', $o['LastTimeToUnBook']);
        if (isset($o['PriceMappings'])) $this->PriceMappings = JsonConverters::fromArray('PriceMapping', $o['PriceMappings']);
        if (isset($o['UpdatedDate'])) $this->UpdatedDate = JsonConverters::from('DateTime', $o['UpdatedDate']);
        if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['CustomerId'])) $this->CustomerId = $o['CustomerId'];
        if (isset($o['ServiceId'])) $this->ServiceId = $o['ServiceId'];
        if (isset($o['StatusId'])) $this->StatusId = $o['StatusId'];
        if (isset($o['UnbookedOn'])) $this->UnbookedOn = JsonConverters::from('DateTime', $o['UnbookedOn']);
        if (isset($o['UnbookedComments'])) $this->UnbookedComments = $o['UnbookedComments'];
        if (isset($o['BookedComments'])) $this->BookedComments = $o['BookedComments'];
        if (isset($o['BookedBy'])) $this->BookedBy = $o['BookedBy'];
        if (isset($o['UnBookedBy'])) $this->UnBookedBy = $o['UnBookedBy'];
        if (isset($o['SendSmsReminder'])) $this->SendSmsReminder = $o['SendSmsReminder'];
        if (isset($o['SendEmailReminder'])) $this->SendEmailReminder = $o['SendEmailReminder'];
        if (isset($o['SendSmsConfirmation'])) $this->SendSmsConfirmation = $o['SendSmsConfirmation'];
        if (isset($o['RebateCode'])) $this->RebateCode = $o['RebateCode'];
        if (isset($o['Comments'])) $this->Comments = $o['Comments'];
        if (isset($o['IpAddress'])) $this->IpAddress = $o['IpAddress'];
        if (isset($o['NumberOfBookedSpots'])) $this->NumberOfBookedSpots = $o['NumberOfBookedSpots'];
        if (isset($o['CommentsToCustomer'])) $this->CommentsToCustomer = $o['CommentsToCustomer'];
        if (isset($o['PaymentExpiration'])) $this->PaymentExpiration = JsonConverters::from('DateTime', $o['PaymentExpiration']);
        if (isset($o['PriceVat'])) $this->PriceVat = $o['PriceVat'];
        if (isset($o['SendEmailConfirmation'])) $this->SendEmailConfirmation = $o['SendEmailConfirmation'];
        if (isset($o['CancellationCode'])) $this->CancellationCode = $o['CancellationCode'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['RatingCode'])) $this->RatingCode = $o['RatingCode'];
        if (isset($o['TextField1'])) $this->TextField1 = $o['TextField1'];
        if (isset($o['TextField2'])) $this->TextField2 = $o['TextField2'];
        if (isset($o['TextField3'])) $this->TextField3 = $o['TextField3'];
        if (isset($o['TextField4'])) $this->TextField4 = $o['TextField4'];
        if (isset($o['TextField5'])) $this->TextField5 = $o['TextField5'];
        if (isset($o['TextField6'])) $this->TextField6 = $o['TextField6'];
        if (isset($o['TextField7'])) $this->TextField7 = $o['TextField7'];
        if (isset($o['TextField8'])) $this->TextField8 = $o['TextField8'];
        if (isset($o['TextField9'])) $this->TextField9 = $o['TextField9'];
        if (isset($o['TextField10'])) $this->TextField10 = $o['TextField10'];
        if (isset($o['TextField11'])) $this->TextField11 = $o['TextField11'];
        if (isset($o['TextField12'])) $this->TextField12 = $o['TextField12'];
        if (isset($o['TextField13'])) $this->TextField13 = $o['TextField13'];
        if (isset($o['TextField14'])) $this->TextField14 = $o['TextField14'];
        if (isset($o['TextField15'])) $this->TextField15 = $o['TextField15'];
        if (isset($o['TextField16'])) $this->TextField16 = $o['TextField16'];
        if (isset($o['TextField17'])) $this->TextField17 = $o['TextField17'];
        if (isset($o['TextField18'])) $this->TextField18 = $o['TextField18'];
        if (isset($o['TextField19'])) $this->TextField19 = $o['TextField19'];
        if (isset($o['TextField20'])) $this->TextField20 = $o['TextField20'];
        if (isset($o['From'])) $this->From = JsonConverters::from('DateTime', $o['From']);
        if (isset($o['To'])) $this->To = JsonConverters::from('DateTime', $o['To']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Customer)) $o['Customer'] = JsonConverters::to('Customer', $this->Customer);
        if (isset($this->Service)) $o['Service'] = JsonConverters::to('Service', $this->Service);
        if (isset($this->CalendarExport)) $o['CalendarExport'] = JsonConverters::to('CalendarExport', $this->CalendarExport);
        if (isset($this->Log)) $o['Log'] = JsonConverters::toArray('BookingLog', $this->Log);
        if (isset($this->PaymentLog)) $o['PaymentLog'] = JsonConverters::toArray('PaymentLog', $this->PaymentLog);
        if (isset($this->CheckoutLogs)) $o['CheckoutLogs'] = JsonConverters::toArray('PaymentDetails', $this->CheckoutLogs);
        if (isset($this->Prices)) $o['Prices'] = JsonConverters::toArray('BookingPrice', $this->Prices);
        if (isset($this->Status)) $o['Status'] = JsonConverters::to('BookingStatusEnum', $this->Status);
        if (isset($this->isReserved)) $o['isReserved'] = $this->isReserved;
        if (isset($this->StatusName)) $o['StatusName'] = $this->StatusName;
        if (isset($this->Company)) $o['Company'] = JsonConverters::to('Company', $this->Company);
        if (isset($this->CurrencyId)) $o['CurrencyId'] = $this->CurrencyId;
        if (isset($this->CurrencyInfo)) $o['CurrencyInfo'] = JsonConverters::to('Currency', $this->CurrencyInfo);
        if (isset($this->BookingStatus)) $o['BookingStatus'] = JsonConverters::to('BookingStatus', $this->BookingStatus);
        if (isset($this->TotalPrice)) $o['TotalPrice'] = $this->TotalPrice;
        if (isset($this->TotalSpots)) $o['TotalSpots'] = $this->TotalSpots;
        if (isset($this->Resources)) $o['Resources'] = JsonConverters::toArray('Resource', $this->Resources);
        if (isset($this->ExternalReferences)) $o['ExternalReferences'] = JsonConverters::toArray('ExternalReference', $this->ExternalReferences);
        if (isset($this->BookedResources)) $o['BookedResources'] = JsonConverters::toArray('BookedResourceType', $this->BookedResources);
        if (isset($this->CustomFieldsConfig)) $o['CustomFieldsConfig'] = JsonConverters::toArray('CustomFieldConfig', $this->CustomFieldsConfig);
        if (isset($this->CustomFieldsData)) $o['CustomFieldsData'] = JsonConverters::toArray('CustomFieldDataResponse', $this->CustomFieldsData);
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->LastTimeToUnBook)) $o['LastTimeToUnBook'] = JsonConverters::to('DateTime', $this->LastTimeToUnBook);
        if (isset($this->PriceMappings)) $o['PriceMappings'] = JsonConverters::toArray('PriceMapping', $this->PriceMappings);
        if (isset($this->UpdatedDate)) $o['UpdatedDate'] = JsonConverters::to('DateTime', $this->UpdatedDate);
        if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->CustomerId)) $o['CustomerId'] = $this->CustomerId;
        if (isset($this->ServiceId)) $o['ServiceId'] = $this->ServiceId;
        if (isset($this->StatusId)) $o['StatusId'] = $this->StatusId;
        if (isset($this->UnbookedOn)) $o['UnbookedOn'] = JsonConverters::to('DateTime', $this->UnbookedOn);
        if (isset($this->UnbookedComments)) $o['UnbookedComments'] = $this->UnbookedComments;
        if (isset($this->BookedComments)) $o['BookedComments'] = $this->BookedComments;
        if (isset($this->BookedBy)) $o['BookedBy'] = $this->BookedBy;
        if (isset($this->UnBookedBy)) $o['UnBookedBy'] = $this->UnBookedBy;
        if (isset($this->SendSmsReminder)) $o['SendSmsReminder'] = $this->SendSmsReminder;
        if (isset($this->SendEmailReminder)) $o['SendEmailReminder'] = $this->SendEmailReminder;
        if (isset($this->SendSmsConfirmation)) $o['SendSmsConfirmation'] = $this->SendSmsConfirmation;
        if (isset($this->RebateCode)) $o['RebateCode'] = $this->RebateCode;
        if (isset($this->Comments)) $o['Comments'] = $this->Comments;
        if (isset($this->IpAddress)) $o['IpAddress'] = $this->IpAddress;
        if (isset($this->NumberOfBookedSpots)) $o['NumberOfBookedSpots'] = $this->NumberOfBookedSpots;
        if (isset($this->CommentsToCustomer)) $o['CommentsToCustomer'] = $this->CommentsToCustomer;
        if (isset($this->PaymentExpiration)) $o['PaymentExpiration'] = JsonConverters::to('DateTime', $this->PaymentExpiration);
        if (isset($this->PriceVat)) $o['PriceVat'] = $this->PriceVat;
        if (isset($this->SendEmailConfirmation)) $o['SendEmailConfirmation'] = $this->SendEmailConfirmation;
        if (isset($this->CancellationCode)) $o['CancellationCode'] = $this->CancellationCode;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->RatingCode)) $o['RatingCode'] = $this->RatingCode;
        if (isset($this->TextField1)) $o['TextField1'] = $this->TextField1;
        if (isset($this->TextField2)) $o['TextField2'] = $this->TextField2;
        if (isset($this->TextField3)) $o['TextField3'] = $this->TextField3;
        if (isset($this->TextField4)) $o['TextField4'] = $this->TextField4;
        if (isset($this->TextField5)) $o['TextField5'] = $this->TextField5;
        if (isset($this->TextField6)) $o['TextField6'] = $this->TextField6;
        if (isset($this->TextField7)) $o['TextField7'] = $this->TextField7;
        if (isset($this->TextField8)) $o['TextField8'] = $this->TextField8;
        if (isset($this->TextField9)) $o['TextField9'] = $this->TextField9;
        if (isset($this->TextField10)) $o['TextField10'] = $this->TextField10;
        if (isset($this->TextField11)) $o['TextField11'] = $this->TextField11;
        if (isset($this->TextField12)) $o['TextField12'] = $this->TextField12;
        if (isset($this->TextField13)) $o['TextField13'] = $this->TextField13;
        if (isset($this->TextField14)) $o['TextField14'] = $this->TextField14;
        if (isset($this->TextField15)) $o['TextField15'] = $this->TextField15;
        if (isset($this->TextField16)) $o['TextField16'] = $this->TextField16;
        if (isset($this->TextField17)) $o['TextField17'] = $this->TextField17;
        if (isset($this->TextField18)) $o['TextField18'] = $this->TextField18;
        if (isset($this->TextField19)) $o['TextField19'] = $this->TextField19;
        if (isset($this->TextField20)) $o['TextField20'] = $this->TextField20;
        if (isset($this->From)) $o['From'] = JsonConverters::to('DateTime', $this->From);
        if (isset($this->To)) $o['To'] = JsonConverters::to('DateTime', $this->To);
        return empty($o) ? new class(){} : $o;
    }
}

class Service extends BaseModel implements ICustomFieldTable, IBaseModelCreated, IBaseModelUpdated, JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var array<ResourceType>|null */
        public ?array $ResourceTypes=null,

        // @Ignore()
        /** @var array<Resource>|null */
        public ?array $Resources=null,

        // @Ignore()
        /** @var TotalPriceInformation|null */
        public ?TotalPriceInformation $TotalPrice=null,

        // @Ignore()
        /** @var array<ServicePrice>|null */
        public ?array $Prices=null,

        // @Ignore()
        /** @var array<BookingStatusOptions>|null */
        public ?array $BookingStatusOptions=null,

        // @Ignore()
        /** @var bool|null */
        public ?bool $IsGroupBooking=null,

        // @Ignore()
        /** @var bool|null */
        public ?bool $IsMultipleResource=null,

        // @Ignore()
        /** @var BookingSettings|null */
        public ?BookingSettings $Settings=null,

        // @Ignore()
        /** @var PaymentSetting|null */
        public ?PaymentSetting $PaymentSetting=null,

        // @Ignore()
        /** @var array<CustomFieldConfig>|null */
        public ?array $BookingCustomFieldsConfig=null,

        // @Ignore()
        /** @var array<CustomFieldConfig>|null */
        public ?array $CustomerCustomFieldsConfig=null,

        // @Ignore()
        /** @var array<CustomFieldConfig>|null */
        public ?array $CustomFieldsConfig=null,

        // @Ignore()
        /** @var array<CustomFieldDataResponse>|null */
        public ?array $CustomFieldsData=null,

        // @Ignore()
        /** @var array<ISchedule>|null */
        public ?array $Schedules=null,

        // @Ignore()
        /** @var array<Booking>|null */
        public ?array $CustomerActiveBookings=null,

        // @Ignore()
        /** @var ScheduleType|null */
        public ?ScheduleType $ScheduleType=null,

        // @Ignore()
        /** @var DateInterval|null */
        public ?DateInterval $LastTimeToUnbookThreshold=null,

        // @Ignore()
        /** @var DateInterval|null */
        public ?DateInterval $LastTimeToBookThreshold=null,

        // @Ignore()
        /** @var AverageRatingScore|null */
        public ?AverageRatingScore $RatingScore=null,

        // @Ignore()
        /** @var array<Rating>|null */
        public ?array $Ratings=null,

        // @Required()
        /** @var string */
        public string $CompanyId='',

        /** @var int */
        public int $Id=0,
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Description='',

        /** @var string|null */
        public ?string $Group=null,
        // @Required()
        /** @var bool|null */
        public ?bool $Active=null,

        // @Required()
        /** @var int */
        public int $SortOrder=0,

        // @Required()
        /** @var int */
        public int $PauseAfterBooking=0,

        // @Required()
        /** @var int */
        public int $UnbookBeforeDays=0,

        // @Required()
        /** @var int */
        public int $UnbookBeforeHours=0,

        // @Required()
        /** @var int */
        public int $UnbookBeforeMinutes=0,

        // @Required()
        /** @var int */
        public int $BookBeforeDays=0,

        // @Required()
        /** @var int */
        public int $BookBeforeHours=0,

        // @Required()
        /** @var int */
        public int $BookBeforeMinutes=0,

        /** @var int|null */
        public ?int $Duration=null,
        /** @var int */
        public int $DurationTypeId=0,
        /** @var int|null */
        public ?int $MinDuration=null,
        /** @var int|null */
        public ?int $MaxDuration=null,
        /** @var int|null */
        public ?int $DurationInterval=null,
        /** @var int|null */
        public ?int $TotalSpots=null,
        /** @var string|null */
        public ?string $ImageUrl=null,
        // @Required()
        /** @var int */
        public int $ScheduleTypeId=0,

        // @Required()
        /** @var DateTime */
        public DateTime $UpdatedDate=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $CreatedDate=new DateTime(),

        // @Required()
        /** @var bool|null */
        public ?bool $OnlyVisibleByAdmin=null,

        // @Required()
        /** @var int */
        public int $MaxNumberOfSpotsPerBooking=0,

        // @Required()
        /** @var int */
        public int $MinNumberOfResourcesToBook=0,

        // @Required()
        /** @var int */
        public int $MaxNumberOfResourcesToBook=0,

        // @Required()
        /** @var bool|null */
        public ?bool $IsPaymentEnabled=null,

        // @Required()
        /** @var int */
        public int $MaxPaymentTime=0,

        // @Required()
        /** @var bool|null */
        public ?bool $LockSpotsToBooking=null,

        // @Required()
        /** @var bool|null */
        public ?bool $EnableBookingQueue=null,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var int */
        public int $BookingStatusId=0,

        // @Required()
        /** @var bool|null */
        public ?bool $EnableCodeLockSync=null,

        // @Required()
        /** @var bool|null */
        public ?bool $EnableCustomerManualPayment=null,

        /** @var int|null */
        public ?int $PriceViewTypeId=null,
        /** @var string|null */
        public ?string $TextField1=null,
        /** @var string|null */
        public ?string $TextField2=null,
        /** @var string|null */
        public ?string $TextField3=null,
        /** @var string|null */
        public ?string $TextField4=null,
        /** @var string|null */
        public ?string $TextField5=null,
        /** @var string|null */
        public ?string $TextField6=null,
        /** @var string|null */
        public ?string $TextField7=null,
        /** @var string|null */
        public ?string $TextField8=null,
        /** @var string|null */
        public ?string $TextField9=null,
        /** @var string|null */
        public ?string $TextField10=null,
        /** @var string|null */
        public ?string $TextField11=null,
        /** @var string|null */
        public ?string $TextField12=null,
        /** @var string|null */
        public ?string $TextField13=null,
        /** @var string|null */
        public ?string $TextField14=null,
        /** @var string|null */
        public ?string $TextField15=null,
        /** @var string|null */
        public ?string $TextField16=null,
        /** @var string|null */
        public ?string $TextField17=null,
        /** @var string|null */
        public ?string $TextField18=null,
        /** @var string|null */
        public ?string $TextField19=null,
        /** @var string|null */
        public ?string $TextField20=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['ResourceTypes'])) $this->ResourceTypes = JsonConverters::fromArray('ResourceType', $o['ResourceTypes']);
        if (isset($o['Resources'])) $this->Resources = JsonConverters::fromArray('Resource', $o['Resources']);
        if (isset($o['TotalPrice'])) $this->TotalPrice = JsonConverters::from('TotalPriceInformation', $o['TotalPrice']);
        if (isset($o['Prices'])) $this->Prices = JsonConverters::fromArray('ServicePrice', $o['Prices']);
        if (isset($o['BookingStatusOptions'])) $this->BookingStatusOptions = JsonConverters::fromArray('BookingStatusOptions', $o['BookingStatusOptions']);
        if (isset($o['IsGroupBooking'])) $this->IsGroupBooking = $o['IsGroupBooking'];
        if (isset($o['IsMultipleResource'])) $this->IsMultipleResource = $o['IsMultipleResource'];
        if (isset($o['Settings'])) $this->Settings = JsonConverters::from('BookingSettings', $o['Settings']);
        if (isset($o['PaymentSetting'])) $this->PaymentSetting = JsonConverters::from('PaymentSetting', $o['PaymentSetting']);
        if (isset($o['BookingCustomFieldsConfig'])) $this->BookingCustomFieldsConfig = JsonConverters::fromArray('CustomFieldConfig', $o['BookingCustomFieldsConfig']);
        if (isset($o['CustomerCustomFieldsConfig'])) $this->CustomerCustomFieldsConfig = JsonConverters::fromArray('CustomFieldConfig', $o['CustomerCustomFieldsConfig']);
        if (isset($o['CustomFieldsConfig'])) $this->CustomFieldsConfig = JsonConverters::fromArray('CustomFieldConfig', $o['CustomFieldsConfig']);
        if (isset($o['CustomFieldsData'])) $this->CustomFieldsData = JsonConverters::fromArray('CustomFieldDataResponse', $o['CustomFieldsData']);
        if (isset($o['Schedules'])) $this->Schedules = JsonConverters::fromArray('ISchedule', $o['Schedules']);
        if (isset($o['CustomerActiveBookings'])) $this->CustomerActiveBookings = JsonConverters::fromArray('Booking', $o['CustomerActiveBookings']);
        if (isset($o['ScheduleType'])) $this->ScheduleType = JsonConverters::from('ScheduleType', $o['ScheduleType']);
        if (isset($o['LastTimeToUnbookThreshold'])) $this->LastTimeToUnbookThreshold = JsonConverters::from('DateInterval', $o['LastTimeToUnbookThreshold']);
        if (isset($o['LastTimeToBookThreshold'])) $this->LastTimeToBookThreshold = JsonConverters::from('DateInterval', $o['LastTimeToBookThreshold']);
        if (isset($o['RatingScore'])) $this->RatingScore = JsonConverters::from('AverageRatingScore', $o['RatingScore']);
        if (isset($o['Ratings'])) $this->Ratings = JsonConverters::fromArray('Rating', $o['Ratings']);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        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['Group'])) $this->Group = $o['Group'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['SortOrder'])) $this->SortOrder = $o['SortOrder'];
        if (isset($o['PauseAfterBooking'])) $this->PauseAfterBooking = $o['PauseAfterBooking'];
        if (isset($o['UnbookBeforeDays'])) $this->UnbookBeforeDays = $o['UnbookBeforeDays'];
        if (isset($o['UnbookBeforeHours'])) $this->UnbookBeforeHours = $o['UnbookBeforeHours'];
        if (isset($o['UnbookBeforeMinutes'])) $this->UnbookBeforeMinutes = $o['UnbookBeforeMinutes'];
        if (isset($o['BookBeforeDays'])) $this->BookBeforeDays = $o['BookBeforeDays'];
        if (isset($o['BookBeforeHours'])) $this->BookBeforeHours = $o['BookBeforeHours'];
        if (isset($o['BookBeforeMinutes'])) $this->BookBeforeMinutes = $o['BookBeforeMinutes'];
        if (isset($o['Duration'])) $this->Duration = $o['Duration'];
        if (isset($o['DurationTypeId'])) $this->DurationTypeId = $o['DurationTypeId'];
        if (isset($o['MinDuration'])) $this->MinDuration = $o['MinDuration'];
        if (isset($o['MaxDuration'])) $this->MaxDuration = $o['MaxDuration'];
        if (isset($o['DurationInterval'])) $this->DurationInterval = $o['DurationInterval'];
        if (isset($o['TotalSpots'])) $this->TotalSpots = $o['TotalSpots'];
        if (isset($o['ImageUrl'])) $this->ImageUrl = $o['ImageUrl'];
        if (isset($o['ScheduleTypeId'])) $this->ScheduleTypeId = $o['ScheduleTypeId'];
        if (isset($o['UpdatedDate'])) $this->UpdatedDate = JsonConverters::from('DateTime', $o['UpdatedDate']);
        if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
        if (isset($o['OnlyVisibleByAdmin'])) $this->OnlyVisibleByAdmin = $o['OnlyVisibleByAdmin'];
        if (isset($o['MaxNumberOfSpotsPerBooking'])) $this->MaxNumberOfSpotsPerBooking = $o['MaxNumberOfSpotsPerBooking'];
        if (isset($o['MinNumberOfResourcesToBook'])) $this->MinNumberOfResourcesToBook = $o['MinNumberOfResourcesToBook'];
        if (isset($o['MaxNumberOfResourcesToBook'])) $this->MaxNumberOfResourcesToBook = $o['MaxNumberOfResourcesToBook'];
        if (isset($o['IsPaymentEnabled'])) $this->IsPaymentEnabled = $o['IsPaymentEnabled'];
        if (isset($o['MaxPaymentTime'])) $this->MaxPaymentTime = $o['MaxPaymentTime'];
        if (isset($o['LockSpotsToBooking'])) $this->LockSpotsToBooking = $o['LockSpotsToBooking'];
        if (isset($o['EnableBookingQueue'])) $this->EnableBookingQueue = $o['EnableBookingQueue'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['BookingStatusId'])) $this->BookingStatusId = $o['BookingStatusId'];
        if (isset($o['EnableCodeLockSync'])) $this->EnableCodeLockSync = $o['EnableCodeLockSync'];
        if (isset($o['EnableCustomerManualPayment'])) $this->EnableCustomerManualPayment = $o['EnableCustomerManualPayment'];
        if (isset($o['PriceViewTypeId'])) $this->PriceViewTypeId = $o['PriceViewTypeId'];
        if (isset($o['TextField1'])) $this->TextField1 = $o['TextField1'];
        if (isset($o['TextField2'])) $this->TextField2 = $o['TextField2'];
        if (isset($o['TextField3'])) $this->TextField3 = $o['TextField3'];
        if (isset($o['TextField4'])) $this->TextField4 = $o['TextField4'];
        if (isset($o['TextField5'])) $this->TextField5 = $o['TextField5'];
        if (isset($o['TextField6'])) $this->TextField6 = $o['TextField6'];
        if (isset($o['TextField7'])) $this->TextField7 = $o['TextField7'];
        if (isset($o['TextField8'])) $this->TextField8 = $o['TextField8'];
        if (isset($o['TextField9'])) $this->TextField9 = $o['TextField9'];
        if (isset($o['TextField10'])) $this->TextField10 = $o['TextField10'];
        if (isset($o['TextField11'])) $this->TextField11 = $o['TextField11'];
        if (isset($o['TextField12'])) $this->TextField12 = $o['TextField12'];
        if (isset($o['TextField13'])) $this->TextField13 = $o['TextField13'];
        if (isset($o['TextField14'])) $this->TextField14 = $o['TextField14'];
        if (isset($o['TextField15'])) $this->TextField15 = $o['TextField15'];
        if (isset($o['TextField16'])) $this->TextField16 = $o['TextField16'];
        if (isset($o['TextField17'])) $this->TextField17 = $o['TextField17'];
        if (isset($o['TextField18'])) $this->TextField18 = $o['TextField18'];
        if (isset($o['TextField19'])) $this->TextField19 = $o['TextField19'];
        if (isset($o['TextField20'])) $this->TextField20 = $o['TextField20'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->ResourceTypes)) $o['ResourceTypes'] = JsonConverters::toArray('ResourceType', $this->ResourceTypes);
        if (isset($this->Resources)) $o['Resources'] = JsonConverters::toArray('Resource', $this->Resources);
        if (isset($this->TotalPrice)) $o['TotalPrice'] = JsonConverters::to('TotalPriceInformation', $this->TotalPrice);
        if (isset($this->Prices)) $o['Prices'] = JsonConverters::toArray('ServicePrice', $this->Prices);
        if (isset($this->BookingStatusOptions)) $o['BookingStatusOptions'] = JsonConverters::toArray('BookingStatusOptions', $this->BookingStatusOptions);
        if (isset($this->IsGroupBooking)) $o['IsGroupBooking'] = $this->IsGroupBooking;
        if (isset($this->IsMultipleResource)) $o['IsMultipleResource'] = $this->IsMultipleResource;
        if (isset($this->Settings)) $o['Settings'] = JsonConverters::to('BookingSettings', $this->Settings);
        if (isset($this->PaymentSetting)) $o['PaymentSetting'] = JsonConverters::to('PaymentSetting', $this->PaymentSetting);
        if (isset($this->BookingCustomFieldsConfig)) $o['BookingCustomFieldsConfig'] = JsonConverters::toArray('CustomFieldConfig', $this->BookingCustomFieldsConfig);
        if (isset($this->CustomerCustomFieldsConfig)) $o['CustomerCustomFieldsConfig'] = JsonConverters::toArray('CustomFieldConfig', $this->CustomerCustomFieldsConfig);
        if (isset($this->CustomFieldsConfig)) $o['CustomFieldsConfig'] = JsonConverters::toArray('CustomFieldConfig', $this->CustomFieldsConfig);
        if (isset($this->CustomFieldsData)) $o['CustomFieldsData'] = JsonConverters::toArray('CustomFieldDataResponse', $this->CustomFieldsData);
        if (isset($this->Schedules)) $o['Schedules'] = JsonConverters::toArray('ISchedule', $this->Schedules);
        if (isset($this->CustomerActiveBookings)) $o['CustomerActiveBookings'] = JsonConverters::toArray('Booking', $this->CustomerActiveBookings);
        if (isset($this->ScheduleType)) $o['ScheduleType'] = JsonConverters::to('ScheduleType', $this->ScheduleType);
        if (isset($this->LastTimeToUnbookThreshold)) $o['LastTimeToUnbookThreshold'] = JsonConverters::to('DateInterval', $this->LastTimeToUnbookThreshold);
        if (isset($this->LastTimeToBookThreshold)) $o['LastTimeToBookThreshold'] = JsonConverters::to('DateInterval', $this->LastTimeToBookThreshold);
        if (isset($this->RatingScore)) $o['RatingScore'] = JsonConverters::to('AverageRatingScore', $this->RatingScore);
        if (isset($this->Ratings)) $o['Ratings'] = JsonConverters::toArray('Rating', $this->Ratings);
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        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->Group)) $o['Group'] = $this->Group;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->SortOrder)) $o['SortOrder'] = $this->SortOrder;
        if (isset($this->PauseAfterBooking)) $o['PauseAfterBooking'] = $this->PauseAfterBooking;
        if (isset($this->UnbookBeforeDays)) $o['UnbookBeforeDays'] = $this->UnbookBeforeDays;
        if (isset($this->UnbookBeforeHours)) $o['UnbookBeforeHours'] = $this->UnbookBeforeHours;
        if (isset($this->UnbookBeforeMinutes)) $o['UnbookBeforeMinutes'] = $this->UnbookBeforeMinutes;
        if (isset($this->BookBeforeDays)) $o['BookBeforeDays'] = $this->BookBeforeDays;
        if (isset($this->BookBeforeHours)) $o['BookBeforeHours'] = $this->BookBeforeHours;
        if (isset($this->BookBeforeMinutes)) $o['BookBeforeMinutes'] = $this->BookBeforeMinutes;
        if (isset($this->Duration)) $o['Duration'] = $this->Duration;
        if (isset($this->DurationTypeId)) $o['DurationTypeId'] = $this->DurationTypeId;
        if (isset($this->MinDuration)) $o['MinDuration'] = $this->MinDuration;
        if (isset($this->MaxDuration)) $o['MaxDuration'] = $this->MaxDuration;
        if (isset($this->DurationInterval)) $o['DurationInterval'] = $this->DurationInterval;
        if (isset($this->TotalSpots)) $o['TotalSpots'] = $this->TotalSpots;
        if (isset($this->ImageUrl)) $o['ImageUrl'] = $this->ImageUrl;
        if (isset($this->ScheduleTypeId)) $o['ScheduleTypeId'] = $this->ScheduleTypeId;
        if (isset($this->UpdatedDate)) $o['UpdatedDate'] = JsonConverters::to('DateTime', $this->UpdatedDate);
        if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
        if (isset($this->OnlyVisibleByAdmin)) $o['OnlyVisibleByAdmin'] = $this->OnlyVisibleByAdmin;
        if (isset($this->MaxNumberOfSpotsPerBooking)) $o['MaxNumberOfSpotsPerBooking'] = $this->MaxNumberOfSpotsPerBooking;
        if (isset($this->MinNumberOfResourcesToBook)) $o['MinNumberOfResourcesToBook'] = $this->MinNumberOfResourcesToBook;
        if (isset($this->MaxNumberOfResourcesToBook)) $o['MaxNumberOfResourcesToBook'] = $this->MaxNumberOfResourcesToBook;
        if (isset($this->IsPaymentEnabled)) $o['IsPaymentEnabled'] = $this->IsPaymentEnabled;
        if (isset($this->MaxPaymentTime)) $o['MaxPaymentTime'] = $this->MaxPaymentTime;
        if (isset($this->LockSpotsToBooking)) $o['LockSpotsToBooking'] = $this->LockSpotsToBooking;
        if (isset($this->EnableBookingQueue)) $o['EnableBookingQueue'] = $this->EnableBookingQueue;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->BookingStatusId)) $o['BookingStatusId'] = $this->BookingStatusId;
        if (isset($this->EnableCodeLockSync)) $o['EnableCodeLockSync'] = $this->EnableCodeLockSync;
        if (isset($this->EnableCustomerManualPayment)) $o['EnableCustomerManualPayment'] = $this->EnableCustomerManualPayment;
        if (isset($this->PriceViewTypeId)) $o['PriceViewTypeId'] = $this->PriceViewTypeId;
        if (isset($this->TextField1)) $o['TextField1'] = $this->TextField1;
        if (isset($this->TextField2)) $o['TextField2'] = $this->TextField2;
        if (isset($this->TextField3)) $o['TextField3'] = $this->TextField3;
        if (isset($this->TextField4)) $o['TextField4'] = $this->TextField4;
        if (isset($this->TextField5)) $o['TextField5'] = $this->TextField5;
        if (isset($this->TextField6)) $o['TextField6'] = $this->TextField6;
        if (isset($this->TextField7)) $o['TextField7'] = $this->TextField7;
        if (isset($this->TextField8)) $o['TextField8'] = $this->TextField8;
        if (isset($this->TextField9)) $o['TextField9'] = $this->TextField9;
        if (isset($this->TextField10)) $o['TextField10'] = $this->TextField10;
        if (isset($this->TextField11)) $o['TextField11'] = $this->TextField11;
        if (isset($this->TextField12)) $o['TextField12'] = $this->TextField12;
        if (isset($this->TextField13)) $o['TextField13'] = $this->TextField13;
        if (isset($this->TextField14)) $o['TextField14'] = $this->TextField14;
        if (isset($this->TextField15)) $o['TextField15'] = $this->TextField15;
        if (isset($this->TextField16)) $o['TextField16'] = $this->TextField16;
        if (isset($this->TextField17)) $o['TextField17'] = $this->TextField17;
        if (isset($this->TextField18)) $o['TextField18'] = $this->TextField18;
        if (isset($this->TextField19)) $o['TextField19'] = $this->TextField19;
        if (isset($this->TextField20)) $o['TextField20'] = $this->TextField20;
        return empty($o) ? new class(){} : $o;
    }
}

class CustomFieldServiceRelation extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $CompanyId='',

        /** @var int */
        public int $Id=0,
        // @Required()
        /** @var int */
        public int $CustomFieldConfigId=0,

        // @Required()
        /** @var int */
        public int $ServiceId=0,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['CustomFieldConfigId'])) $this->CustomFieldConfigId = $o['CustomFieldConfigId'];
        if (isset($o['ServiceId'])) $this->ServiceId = $o['ServiceId'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->CustomFieldConfigId)) $o['CustomFieldConfigId'] = $this->CustomFieldConfigId;
        if (isset($this->ServiceId)) $o['ServiceId'] = $this->ServiceId;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        return empty($o) ? new class(){} : $o;
    }
}

class CustomFieldConfig extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var array<CustomFieldValue>|null */
        public ?array $Values=null,

        /** @var CustomField|null */
        public ?CustomField $CustomField=null,
        // @Ignore()
        /** @var RegEx|null */
        public ?RegEx $RegEx=null,

        // @Ignore()
        /** @var array<Service>|null */
        public ?array $Services=null,

        /** @var array<CustomFieldServiceRelation>|null */
        public ?array $CustomFieldServiceRelation=null,
        // @Required()
        /** @var string */
        public string $CompanyId='',

        /** @var int */
        public int $Id=0,
        /** @var int|null */
        public ?int $GroupId=null,
        // @Required()
        /** @var int */
        public int $FieldId=0,

        // @Required()
        /** @var int */
        public int $IconId=0,

        /** @var int|null */
        public ?int $RegExId=null,
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $Description='',

        // @Required()
        /** @var string */
        public string $Datatype='',

        // @Required()
        /** @var int */
        public int $MaxLength=0,

        // @Required()
        /** @var bool|null */
        public ?bool $IsPublic=null,

        // @Required()
        /** @var bool|null */
        public ?bool $IsHidden=null,

        // @Required()
        /** @var bool|null */
        public ?bool $IsMandatory=null,

        /** @var string|null */
        public ?string $DefaultValue=null,
        /** @var string|null */
        public ?string $RegExErrorMessage=null,
        /** @var string|null */
        public ?string $MandatoryErrorMessage=null,
        /** @var int|null */
        public ?int $Width=null,
        // @Required()
        /** @var bool|null */
        public ?bool $MultipleLineText=null,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Values'])) $this->Values = JsonConverters::fromArray('CustomFieldValue', $o['Values']);
        if (isset($o['CustomField'])) $this->CustomField = JsonConverters::from('CustomField', $o['CustomField']);
        if (isset($o['RegEx'])) $this->RegEx = JsonConverters::from('RegEx', $o['RegEx']);
        if (isset($o['Services'])) $this->Services = JsonConverters::fromArray('Service', $o['Services']);
        if (isset($o['CustomFieldServiceRelation'])) $this->CustomFieldServiceRelation = JsonConverters::fromArray('CustomFieldServiceRelation', $o['CustomFieldServiceRelation']);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['GroupId'])) $this->GroupId = $o['GroupId'];
        if (isset($o['FieldId'])) $this->FieldId = $o['FieldId'];
        if (isset($o['IconId'])) $this->IconId = $o['IconId'];
        if (isset($o['RegExId'])) $this->RegExId = $o['RegExId'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Datatype'])) $this->Datatype = $o['Datatype'];
        if (isset($o['MaxLength'])) $this->MaxLength = $o['MaxLength'];
        if (isset($o['IsPublic'])) $this->IsPublic = $o['IsPublic'];
        if (isset($o['IsHidden'])) $this->IsHidden = $o['IsHidden'];
        if (isset($o['IsMandatory'])) $this->IsMandatory = $o['IsMandatory'];
        if (isset($o['DefaultValue'])) $this->DefaultValue = $o['DefaultValue'];
        if (isset($o['RegExErrorMessage'])) $this->RegExErrorMessage = $o['RegExErrorMessage'];
        if (isset($o['MandatoryErrorMessage'])) $this->MandatoryErrorMessage = $o['MandatoryErrorMessage'];
        if (isset($o['Width'])) $this->Width = $o['Width'];
        if (isset($o['MultipleLineText'])) $this->MultipleLineText = $o['MultipleLineText'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Values)) $o['Values'] = JsonConverters::toArray('CustomFieldValue', $this->Values);
        if (isset($this->CustomField)) $o['CustomField'] = JsonConverters::to('CustomField', $this->CustomField);
        if (isset($this->RegEx)) $o['RegEx'] = JsonConverters::to('RegEx', $this->RegEx);
        if (isset($this->Services)) $o['Services'] = JsonConverters::toArray('Service', $this->Services);
        if (isset($this->CustomFieldServiceRelation)) $o['CustomFieldServiceRelation'] = JsonConverters::toArray('CustomFieldServiceRelation', $this->CustomFieldServiceRelation);
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->GroupId)) $o['GroupId'] = $this->GroupId;
        if (isset($this->FieldId)) $o['FieldId'] = $this->FieldId;
        if (isset($this->IconId)) $o['IconId'] = $this->IconId;
        if (isset($this->RegExId)) $o['RegExId'] = $this->RegExId;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Datatype)) $o['Datatype'] = $this->Datatype;
        if (isset($this->MaxLength)) $o['MaxLength'] = $this->MaxLength;
        if (isset($this->IsPublic)) $o['IsPublic'] = $this->IsPublic;
        if (isset($this->IsHidden)) $o['IsHidden'] = $this->IsHidden;
        if (isset($this->IsMandatory)) $o['IsMandatory'] = $this->IsMandatory;
        if (isset($this->DefaultValue)) $o['DefaultValue'] = $this->DefaultValue;
        if (isset($this->RegExErrorMessage)) $o['RegExErrorMessage'] = $this->RegExErrorMessage;
        if (isset($this->MandatoryErrorMessage)) $o['MandatoryErrorMessage'] = $this->MandatoryErrorMessage;
        if (isset($this->Width)) $o['Width'] = $this->Width;
        if (isset($this->MultipleLineText)) $o['MultipleLineText'] = $this->MultipleLineText;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        return empty($o) ? new class(){} : $o;
    }
}

class Resource extends BaseModel implements ICustomFieldTable, IBaseModelCreated, IBaseModelUpdated, JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var int */
        public int $Priority=0,

        // @Ignore()
        /** @var array<ISchedule>|null */
        public ?array $Schedules=null,

        // @Ignore()
        /** @var array<ITimeException>|null */
        public ?array $Exceptions=null,

        // @Ignore()
        /** @var array<IBookedTime>|null */
        public ?array $Bookings=null,

        // @Ignore()
        /** @var array<CustomFieldConfig>|null */
        public ?array $CustomFieldsConfig=null,

        // @Ignore()
        /** @var array<CustomFieldDataResponse>|null */
        public ?array $CustomFieldsData=null,

        // @Required()
        /** @var string */
        public string $CompanyId='',

        /** @var int */
        public int $Id=0,
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var bool|null */
        public ?bool $Active=null,

        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $ImageUrl=null,
        // @Required()
        /** @var DateTime */
        public DateTime $UpdatedDate=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $CreatedDate=new DateTime(),

        // @Required()
        /** @var string */
        public string $Color='',

        /** @var string|null */
        public ?string $Email=null,
        /** @var string|null */
        public ?string $MobilePhone=null,
        /** @var bool|null */
        public ?bool $EmailNotification=null,
        /** @var bool|null */
        public ?bool $SMSNotification=null,
        // @Required()
        /** @var bool|null */
        public ?bool $SendSMSReminder=null,

        // @Required()
        /** @var bool|null */
        public ?bool $SendEmailReminder=null,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var string|null */
        public ?string $AccessGroup=null,
        /** @var string|null */
        public ?string $TextField1=null,
        /** @var string|null */
        public ?string $TextField2=null,
        /** @var string|null */
        public ?string $TextField3=null,
        /** @var string|null */
        public ?string $TextField4=null,
        /** @var string|null */
        public ?string $TextField5=null,
        /** @var string|null */
        public ?string $TextField6=null,
        /** @var string|null */
        public ?string $TextField7=null,
        /** @var string|null */
        public ?string $TextField8=null,
        /** @var string|null */
        public ?string $TextField9=null,
        /** @var string|null */
        public ?string $TextField10=null,
        /** @var string|null */
        public ?string $TextField11=null,
        /** @var string|null */
        public ?string $TextField12=null,
        /** @var string|null */
        public ?string $TextField13=null,
        /** @var string|null */
        public ?string $TextField14=null,
        /** @var string|null */
        public ?string $TextField15=null,
        /** @var string|null */
        public ?string $TextField16=null,
        /** @var string|null */
        public ?string $TextField17=null,
        /** @var string|null */
        public ?string $TextField18=null,
        /** @var string|null */
        public ?string $TextField19=null,
        /** @var string|null */
        public ?string $TextField20=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Priority'])) $this->Priority = $o['Priority'];
        if (isset($o['Schedules'])) $this->Schedules = JsonConverters::fromArray('ISchedule', $o['Schedules']);
        if (isset($o['Exceptions'])) $this->Exceptions = JsonConverters::fromArray('ITimeException', $o['Exceptions']);
        if (isset($o['Bookings'])) $this->Bookings = JsonConverters::fromArray('IBookedTime', $o['Bookings']);
        if (isset($o['CustomFieldsConfig'])) $this->CustomFieldsConfig = JsonConverters::fromArray('CustomFieldConfig', $o['CustomFieldsConfig']);
        if (isset($o['CustomFieldsData'])) $this->CustomFieldsData = JsonConverters::fromArray('CustomFieldDataResponse', $o['CustomFieldsData']);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ImageUrl'])) $this->ImageUrl = $o['ImageUrl'];
        if (isset($o['UpdatedDate'])) $this->UpdatedDate = JsonConverters::from('DateTime', $o['UpdatedDate']);
        if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
        if (isset($o['Color'])) $this->Color = $o['Color'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['MobilePhone'])) $this->MobilePhone = $o['MobilePhone'];
        if (isset($o['EmailNotification'])) $this->EmailNotification = $o['EmailNotification'];
        if (isset($o['SMSNotification'])) $this->SMSNotification = $o['SMSNotification'];
        if (isset($o['SendSMSReminder'])) $this->SendSMSReminder = $o['SendSMSReminder'];
        if (isset($o['SendEmailReminder'])) $this->SendEmailReminder = $o['SendEmailReminder'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['AccessGroup'])) $this->AccessGroup = $o['AccessGroup'];
        if (isset($o['TextField1'])) $this->TextField1 = $o['TextField1'];
        if (isset($o['TextField2'])) $this->TextField2 = $o['TextField2'];
        if (isset($o['TextField3'])) $this->TextField3 = $o['TextField3'];
        if (isset($o['TextField4'])) $this->TextField4 = $o['TextField4'];
        if (isset($o['TextField5'])) $this->TextField5 = $o['TextField5'];
        if (isset($o['TextField6'])) $this->TextField6 = $o['TextField6'];
        if (isset($o['TextField7'])) $this->TextField7 = $o['TextField7'];
        if (isset($o['TextField8'])) $this->TextField8 = $o['TextField8'];
        if (isset($o['TextField9'])) $this->TextField9 = $o['TextField9'];
        if (isset($o['TextField10'])) $this->TextField10 = $o['TextField10'];
        if (isset($o['TextField11'])) $this->TextField11 = $o['TextField11'];
        if (isset($o['TextField12'])) $this->TextField12 = $o['TextField12'];
        if (isset($o['TextField13'])) $this->TextField13 = $o['TextField13'];
        if (isset($o['TextField14'])) $this->TextField14 = $o['TextField14'];
        if (isset($o['TextField15'])) $this->TextField15 = $o['TextField15'];
        if (isset($o['TextField16'])) $this->TextField16 = $o['TextField16'];
        if (isset($o['TextField17'])) $this->TextField17 = $o['TextField17'];
        if (isset($o['TextField18'])) $this->TextField18 = $o['TextField18'];
        if (isset($o['TextField19'])) $this->TextField19 = $o['TextField19'];
        if (isset($o['TextField20'])) $this->TextField20 = $o['TextField20'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Priority)) $o['Priority'] = $this->Priority;
        if (isset($this->Schedules)) $o['Schedules'] = JsonConverters::toArray('ISchedule', $this->Schedules);
        if (isset($this->Exceptions)) $o['Exceptions'] = JsonConverters::toArray('ITimeException', $this->Exceptions);
        if (isset($this->Bookings)) $o['Bookings'] = JsonConverters::toArray('IBookedTime', $this->Bookings);
        if (isset($this->CustomFieldsConfig)) $o['CustomFieldsConfig'] = JsonConverters::toArray('CustomFieldConfig', $this->CustomFieldsConfig);
        if (isset($this->CustomFieldsData)) $o['CustomFieldsData'] = JsonConverters::toArray('CustomFieldDataResponse', $this->CustomFieldsData);
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ImageUrl)) $o['ImageUrl'] = $this->ImageUrl;
        if (isset($this->UpdatedDate)) $o['UpdatedDate'] = JsonConverters::to('DateTime', $this->UpdatedDate);
        if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
        if (isset($this->Color)) $o['Color'] = $this->Color;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->MobilePhone)) $o['MobilePhone'] = $this->MobilePhone;
        if (isset($this->EmailNotification)) $o['EmailNotification'] = $this->EmailNotification;
        if (isset($this->SMSNotification)) $o['SMSNotification'] = $this->SMSNotification;
        if (isset($this->SendSMSReminder)) $o['SendSMSReminder'] = $this->SendSMSReminder;
        if (isset($this->SendEmailReminder)) $o['SendEmailReminder'] = $this->SendEmailReminder;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->AccessGroup)) $o['AccessGroup'] = $this->AccessGroup;
        if (isset($this->TextField1)) $o['TextField1'] = $this->TextField1;
        if (isset($this->TextField2)) $o['TextField2'] = $this->TextField2;
        if (isset($this->TextField3)) $o['TextField3'] = $this->TextField3;
        if (isset($this->TextField4)) $o['TextField4'] = $this->TextField4;
        if (isset($this->TextField5)) $o['TextField5'] = $this->TextField5;
        if (isset($this->TextField6)) $o['TextField6'] = $this->TextField6;
        if (isset($this->TextField7)) $o['TextField7'] = $this->TextField7;
        if (isset($this->TextField8)) $o['TextField8'] = $this->TextField8;
        if (isset($this->TextField9)) $o['TextField9'] = $this->TextField9;
        if (isset($this->TextField10)) $o['TextField10'] = $this->TextField10;
        if (isset($this->TextField11)) $o['TextField11'] = $this->TextField11;
        if (isset($this->TextField12)) $o['TextField12'] = $this->TextField12;
        if (isset($this->TextField13)) $o['TextField13'] = $this->TextField13;
        if (isset($this->TextField14)) $o['TextField14'] = $this->TextField14;
        if (isset($this->TextField15)) $o['TextField15'] = $this->TextField15;
        if (isset($this->TextField16)) $o['TextField16'] = $this->TextField16;
        if (isset($this->TextField17)) $o['TextField17'] = $this->TextField17;
        if (isset($this->TextField18)) $o['TextField18'] = $this->TextField18;
        if (isset($this->TextField19)) $o['TextField19'] = $this->TextField19;
        if (isset($this->TextField20)) $o['TextField20'] = $this->TextField20;
        return empty($o) ? new class(){} : $o;
    }
}

class ResourceType extends BaseModel implements IBaseModelCreated, IBaseModelUpdated, JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var bool|null */
        public ?bool $SelectableByUser=null,

        // @Ignore()
        /** @var array<Resource>|null */
        public ?array $Resources=null,

        // @Required()
        /** @var string */
        public string $CompanyId='',

        /** @var int */
        public int $Id=0,
        // @Required()
        /** @var string */
        public string $Name='',

        /** @var string|null */
        public ?string $Description=null,
        // @Required()
        /** @var bool|null */
        public ?bool $Active=null,

        // @Required()
        /** @var DateTime */
        public DateTime $UpdatedDate=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $CreatedDate=new DateTime(),

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['SelectableByUser'])) $this->SelectableByUser = $o['SelectableByUser'];
        if (isset($o['Resources'])) $this->Resources = JsonConverters::fromArray('Resource', $o['Resources']);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        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['Active'])) $this->Active = $o['Active'];
        if (isset($o['UpdatedDate'])) $this->UpdatedDate = JsonConverters::from('DateTime', $o['UpdatedDate']);
        if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->SelectableByUser)) $o['SelectableByUser'] = $this->SelectableByUser;
        if (isset($this->Resources)) $o['Resources'] = JsonConverters::toArray('Resource', $this->Resources);
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        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->Active)) $o['Active'] = $this->Active;
        if (isset($this->UpdatedDate)) $o['UpdatedDate'] = JsonConverters::to('DateTime', $this->UpdatedDate);
        if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        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")
/**
 * @template QueryDb2 of ResourceType
 * @template QueryDb21 of ResourceTypeQueryResponse
 */
class ResourceTypeQuery extends QueryDb2 implements JsonSerializable
{
    /**
     * @param int|null $Skip
     * @param int|null $Take
     * @param string|null $OrderBy
     * @param string|null $OrderByDesc
     * @param string|null $Include
     * @param string|null $Fields
     * @param array<string,string>|null $Meta
     */
    public function __construct(
        ?int $Skip=null,
        ?int $Take=null,
        ?string $OrderBy=null,
        ?string $OrderByDesc=null,
        ?string $Include=null,
        ?string $Fields=null,
        ?array $Meta=null,
        /** @description Enter the company and id you want to see the information for a resourcetype, if blank company id and you are an admin, your company id will be used. If blank id, all resources will be shown  */
        // @ApiMember(Description="Enter the company and id you want to see the information for a resourcetype, if blank company id and you are an admin, your company id will be used. If blank id, all resources will be shown ", IsRequired=true, ParameterType="query")
        /** @var string */
        public string $CompanyId='',

        /** @description Enter the id for a resourcetype. If blank id, all resourctypes will be shown  */
        // @ApiMember(Description="Enter the id for a resourcetype. If blank id, all resourctypes will be shown ", ParameterType="query")
        /** @var int|null */
        public ?int $Id=null,

        /** @description Filter on active or deactivated resourcetypes. If blank status, all resourctypes will be shown  */
        // @ApiMember(Description="Filter on active or deactivated resourcetypes. If blank status, all resourctypes will be shown ", ParameterType="query")
        /** @var bool|null */
        public ?bool $Active=null,

        /** @description If you want to include the connected resources */
        // @ApiMember(DataType="boolean", Description="If you want to include the connected resources", ParameterType="query")
        /** @var bool|null */
        public ?bool $IncludeResources=null
    ) {
        parent::__construct($Skip,$Take,$OrderBy,$OrderByDesc,$Include,$Fields,$Meta);
    }

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

class Currency extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $Name='',

        // @Required()
        /** @var string */
        public string $CurrencySign='',

        // @Required()
        /** @var bool|null */
        public ?bool $Active=null,

        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        // @Required()
        /** @var string */
        public string $Id=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['CurrencySign'])) $this->CurrencySign = $o['CurrencySign'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->CurrencySign)) $o['CurrencySign'] = $this->CurrencySign;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        return empty($o) ? new class(){} : $o;
    }
}

class Customer extends BaseModel implements IUser, ICustomFieldTable, JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $IdentityId=0,
        /** @var string */
        public string $Id='',
        // @Ignore()
        /** @var string */
        public string $CustomerId='',

        // @Ignore()
        /** @var array<UserAccessKeys>|null */
        public ?array $AccessKeys=null,

        /** @var string|null */
        public ?string $Email=null,
        // @Ignore()
        /** @var array<ExternalReference>|null */
        public ?array $ExternalReferences=null,

        // @Ignore()
        /** @var array<CustomFieldConfig>|null */
        public ?array $CustomFieldsConfig=null,

        // @Ignore()
        /** @var array<CustomFieldDataResponse>|null */
        public ?array $CustomFieldsData=null,

        // @Ignore()
        /** @var array<CustomerComment>|null */
        public ?array $Comments=null,

        /** @var string|null */
        public ?string $Firstname=null,
        // @Ignore()
        /** @var string|null */
        public ?string $ImageUrl=null,

        // @Required()
        /** @var bool|null */
        public ?bool $Active=null,

        /** @var string|null */
        public ?string $FacebookUsername=null,
        // @Required()
        /** @var DateTime */
        public DateTime $Updated=new DateTime(),

        // @Required()
        /** @var DateTime */
        public DateTime $Created=new DateTime(),

        /** @var string|null */
        public ?string $IpAddress=null,
        /** @var DateTime|null */
        public ?DateTime $ModifiedDate=null,
        /** @var string|null */
        public ?string $TextField1=null,
        /** @var string|null */
        public ?string $TextField2=null,
        /** @var string|null */
        public ?string $TextField3=null,
        /** @var string|null */
        public ?string $TextField4=null,
        /** @var string|null */
        public ?string $TextField5=null,
        /** @var string|null */
        public ?string $TextField6=null,
        /** @var string|null */
        public ?string $TextField7=null,
        /** @var string|null */
        public ?string $TextField8=null,
        /** @var string|null */
        public ?string $TextField9=null,
        /** @var string|null */
        public ?string $TextField10=null,
        /** @var string|null */
        public ?string $TextField11=null,
        /** @var string|null */
        public ?string $TextField12=null,
        /** @var string|null */
        public ?string $TextField13=null,
        /** @var string|null */
        public ?string $TextField14=null,
        /** @var string|null */
        public ?string $TextField15=null,
        /** @var string|null */
        public ?string $TextField16=null,
        /** @var string|null */
        public ?string $TextField17=null,
        /** @var string|null */
        public ?string $TextField18=null,
        /** @var string|null */
        public ?string $TextField19=null,
        /** @var string|null */
        public ?string $TextField20=null,
        /** @var string */
        public string $UserId='',
        /** @var string|null */
        public ?string $Lastname=null,
        /** @var string|null */
        public ?string $Phone=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,
        // @Required()
        /** @var string */
        public string $CompanyId='',

        /** @var bool|null */
        public ?bool $SubscribedToNewsletter=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['IdentityId'])) $this->IdentityId = $o['IdentityId'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['CustomerId'])) $this->CustomerId = $o['CustomerId'];
        if (isset($o['AccessKeys'])) $this->AccessKeys = JsonConverters::fromArray('UserAccessKeys', $o['AccessKeys']);
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['ExternalReferences'])) $this->ExternalReferences = JsonConverters::fromArray('ExternalReference', $o['ExternalReferences']);
        if (isset($o['CustomFieldsConfig'])) $this->CustomFieldsConfig = JsonConverters::fromArray('CustomFieldConfig', $o['CustomFieldsConfig']);
        if (isset($o['CustomFieldsData'])) $this->CustomFieldsData = JsonConverters::fromArray('CustomFieldDataResponse', $o['CustomFieldsData']);
        if (isset($o['Comments'])) $this->Comments = JsonConverters::fromArray('CustomerComment', $o['Comments']);
        if (isset($o['Firstname'])) $this->Firstname = $o['Firstname'];
        if (isset($o['ImageUrl'])) $this->ImageUrl = $o['ImageUrl'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['FacebookUsername'])) $this->FacebookUsername = $o['FacebookUsername'];
        if (isset($o['Updated'])) $this->Updated = JsonConverters::from('DateTime', $o['Updated']);
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['IpAddress'])) $this->IpAddress = $o['IpAddress'];
        if (isset($o['ModifiedDate'])) $this->ModifiedDate = JsonConverters::from('DateTimeOffset', $o['ModifiedDate']);
        if (isset($o['TextField1'])) $this->TextField1 = $o['TextField1'];
        if (isset($o['TextField2'])) $this->TextField2 = $o['TextField2'];
        if (isset($o['TextField3'])) $this->TextField3 = $o['TextField3'];
        if (isset($o['TextField4'])) $this->TextField4 = $o['TextField4'];
        if (isset($o['TextField5'])) $this->TextField5 = $o['TextField5'];
        if (isset($o['TextField6'])) $this->TextField6 = $o['TextField6'];
        if (isset($o['TextField7'])) $this->TextField7 = $o['TextField7'];
        if (isset($o['TextField8'])) $this->TextField8 = $o['TextField8'];
        if (isset($o['TextField9'])) $this->TextField9 = $o['TextField9'];
        if (isset($o['TextField10'])) $this->TextField10 = $o['TextField10'];
        if (isset($o['TextField11'])) $this->TextField11 = $o['TextField11'];
        if (isset($o['TextField12'])) $this->TextField12 = $o['TextField12'];
        if (isset($o['TextField13'])) $this->TextField13 = $o['TextField13'];
        if (isset($o['TextField14'])) $this->TextField14 = $o['TextField14'];
        if (isset($o['TextField15'])) $this->TextField15 = $o['TextField15'];
        if (isset($o['TextField16'])) $this->TextField16 = $o['TextField16'];
        if (isset($o['TextField17'])) $this->TextField17 = $o['TextField17'];
        if (isset($o['TextField18'])) $this->TextField18 = $o['TextField18'];
        if (isset($o['TextField19'])) $this->TextField19 = $o['TextField19'];
        if (isset($o['TextField20'])) $this->TextField20 = $o['TextField20'];
        if (isset($o['UserId'])) $this->UserId = $o['UserId'];
        if (isset($o['Lastname'])) $this->Lastname = $o['Lastname'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        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'];
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['SubscribedToNewsletter'])) $this->SubscribedToNewsletter = $o['SubscribedToNewsletter'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->IdentityId)) $o['IdentityId'] = $this->IdentityId;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->CustomerId)) $o['CustomerId'] = $this->CustomerId;
        if (isset($this->AccessKeys)) $o['AccessKeys'] = JsonConverters::toArray('UserAccessKeys', $this->AccessKeys);
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->ExternalReferences)) $o['ExternalReferences'] = JsonConverters::toArray('ExternalReference', $this->ExternalReferences);
        if (isset($this->CustomFieldsConfig)) $o['CustomFieldsConfig'] = JsonConverters::toArray('CustomFieldConfig', $this->CustomFieldsConfig);
        if (isset($this->CustomFieldsData)) $o['CustomFieldsData'] = JsonConverters::toArray('CustomFieldDataResponse', $this->CustomFieldsData);
        if (isset($this->Comments)) $o['Comments'] = JsonConverters::toArray('CustomerComment', $this->Comments);
        if (isset($this->Firstname)) $o['Firstname'] = $this->Firstname;
        if (isset($this->ImageUrl)) $o['ImageUrl'] = $this->ImageUrl;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->FacebookUsername)) $o['FacebookUsername'] = $this->FacebookUsername;
        if (isset($this->Updated)) $o['Updated'] = JsonConverters::to('DateTime', $this->Updated);
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->IpAddress)) $o['IpAddress'] = $this->IpAddress;
        if (isset($this->ModifiedDate)) $o['ModifiedDate'] = JsonConverters::to('DateTimeOffset', $this->ModifiedDate);
        if (isset($this->TextField1)) $o['TextField1'] = $this->TextField1;
        if (isset($this->TextField2)) $o['TextField2'] = $this->TextField2;
        if (isset($this->TextField3)) $o['TextField3'] = $this->TextField3;
        if (isset($this->TextField4)) $o['TextField4'] = $this->TextField4;
        if (isset($this->TextField5)) $o['TextField5'] = $this->TextField5;
        if (isset($this->TextField6)) $o['TextField6'] = $this->TextField6;
        if (isset($this->TextField7)) $o['TextField7'] = $this->TextField7;
        if (isset($this->TextField8)) $o['TextField8'] = $this->TextField8;
        if (isset($this->TextField9)) $o['TextField9'] = $this->TextField9;
        if (isset($this->TextField10)) $o['TextField10'] = $this->TextField10;
        if (isset($this->TextField11)) $o['TextField11'] = $this->TextField11;
        if (isset($this->TextField12)) $o['TextField12'] = $this->TextField12;
        if (isset($this->TextField13)) $o['TextField13'] = $this->TextField13;
        if (isset($this->TextField14)) $o['TextField14'] = $this->TextField14;
        if (isset($this->TextField15)) $o['TextField15'] = $this->TextField15;
        if (isset($this->TextField16)) $o['TextField16'] = $this->TextField16;
        if (isset($this->TextField17)) $o['TextField17'] = $this->TextField17;
        if (isset($this->TextField18)) $o['TextField18'] = $this->TextField18;
        if (isset($this->TextField19)) $o['TextField19'] = $this->TextField19;
        if (isset($this->TextField20)) $o['TextField20'] = $this->TextField20;
        if (isset($this->UserId)) $o['UserId'] = $this->UserId;
        if (isset($this->Lastname)) $o['Lastname'] = $this->Lastname;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        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;
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->SubscribedToNewsletter)) $o['SubscribedToNewsletter'] = $this->SubscribedToNewsletter;
        return empty($o) ? new class(){} : $o;
    }
}

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

// @DataContract
/**
 * @template AccessKeyTypeResponse
 */
class QueryResponse implements JsonSerializable
{
    public array $genericArgs = [];
    public static function create(array $genericArgs=[]): QueryResponse {
        $to = new QueryResponse();
        $to->genericArgs = $genericArgs;
        return $to;
    }

    public function __construct(
        // @DataMember(Order=1)
        /** @var int */
        public mixed $Offset=0,

        // @DataMember(Order=2)
        /** @var int */
        public mixed $Total=0,

        // @DataMember(Order=3)
        /** @var array<AccessKeyTypeResponse>|null */
        public mixed $Results=null,

        // @DataMember(Order=4)
        /** @var array<string,string>|null */
        public mixed $Meta=null,

        // @DataMember(Order=5)
        /** @var ResponseStatus|null */
        public mixed $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Offset'])) $this->Offset = $o['Offset'];
        if (isset($o['Total'])) $this->Total = $o['Total'];
        if (isset($o['Results'])) $this->Results = JsonConverters::fromArray($this->genericArgs[0], $o['Results']);
        if (isset($o['Meta'])) $this->Meta = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Meta']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Offset)) $o['Offset'] = $this->Offset;
        if (isset($this->Total)) $o['Total'] = $this->Total;
        if (isset($this->Results)) $o['Results'] = JsonConverters::toArray($this->genericArgs[0], $this->Results);
        if (isset($this->Meta)) $o['Meta'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Meta);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

PHP ResourceTypeQuery DTOs

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

HTTP + OTHER

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

GET /resourcetypes HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Offset":0,"Total":0,"Results":[{"Id":0,"Name":"String","Description":"String","Resources":[{"Id":0,"Name":"String","Active":false,"Description":"String","Email":"String","Phone":"String","Color":"String","Priority":0,"EmailNotification":false,"SMSNotification":false,"EmailReminder":false,"SMSReminder":false}],"Active":false}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}