BokaMera.API.Host

<back to all web services

AddResourceTypeToService

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/services/{Id}/addresourcetypeAdd ResourceType(s) to serviceAdd ResourceType(s) to service for the currently logged in user. Note: you will need to add all ResourceType(s) you want to have connected, only administrators are allowed to add ResourceType(s) to services.
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        /** @description The values to select from if Datatype is DropDown for this custom field */
        // @ApiMember(Description="The values to select from if Datatype is DropDown for this custom field")
        /** @var array<CustomFieldValueResponse>|null */
        public ?array $Values=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Width'])) $this->Width = $o['Width'];
        if (isset($o['DataType'])) $this->DataType = $o['DataType'];
        if (isset($o['DefaultValue'])) $this->DefaultValue = $o['DefaultValue'];
        if (isset($o['IsMandatory'])) $this->IsMandatory = $o['IsMandatory'];
        if (isset($o['MandatoryErrorMessage'])) $this->MandatoryErrorMessage = $o['MandatoryErrorMessage'];
        if (isset($o['MaxLength'])) $this->MaxLength = $o['MaxLength'];
        if (isset($o['MultipleLineText'])) $this->MultipleLineText = $o['MultipleLineText'];
        if (isset($o['RegEx'])) $this->RegEx = $o['RegEx'];
        if (isset($o['RegExErrorMessage'])) $this->RegExErrorMessage = $o['RegExErrorMessage'];
        if (isset($o['Values'])) $this->Values = JsonConverters::fromArray('CustomFieldValueResponse', $o['Values']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Width)) $o['Width'] = $this->Width;
        if (isset($this->DataType)) $o['DataType'] = $this->DataType;
        if (isset($this->DefaultValue)) $o['DefaultValue'] = $this->DefaultValue;
        if (isset($this->IsMandatory)) $o['IsMandatory'] = $this->IsMandatory;
        if (isset($this->MandatoryErrorMessage)) $o['MandatoryErrorMessage'] = $this->MandatoryErrorMessage;
        if (isset($this->MaxLength)) $o['MaxLength'] = $this->MaxLength;
        if (isset($this->MultipleLineText)) $o['MultipleLineText'] = $this->MultipleLineText;
        if (isset($this->RegEx)) $o['RegEx'] = $this->RegEx;
        if (isset($this->RegExErrorMessage)) $o['RegExErrorMessage'] = $this->RegExErrorMessage;
        if (isset($this->Values)) $o['Values'] = JsonConverters::toArray('CustomFieldValueResponse', $this->Values);
        return empty($o) ? new class(){} : $o;
    }
}

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

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

class BookingStatusOptionsResponse 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 DayOfWeekDto implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $DayOfWeekId=0,
        /** @var int */
        public int $DotNetDayOfWeekId=0,
        /** @var string|null */
        public ?string $DayOfWeek=null
    ) {
    }

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

class ServiceInfoResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $ImageUrl=null,
        /** @var int|null */
        public ?int $LengthInMinutes=null,
        /** @var int */
        public int $MaxNumberOfSpotsPerBooking=0,
        /** @var int */
        public int $MinNumberOfSpotsPerBooking=0,
        /** @var GroupBookingSettings|null */
        public ?GroupBookingSettings $GroupBooking=null,
        /** @var MultipleResourceSettings|null */
        public ?MultipleResourceSettings $MultipleResource=null,
        /** @var bool|null */
        public ?bool $IsGroupBooking=null,
        /** @var bool|null */
        public ?bool $IsPaymentEnabled=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ImageUrl'])) $this->ImageUrl = JsonConverters::from('string', $o['ImageUrl']);
        if (isset($o['LengthInMinutes'])) $this->LengthInMinutes = $o['LengthInMinutes'];
        if (isset($o['MaxNumberOfSpotsPerBooking'])) $this->MaxNumberOfSpotsPerBooking = $o['MaxNumberOfSpotsPerBooking'];
        if (isset($o['MinNumberOfSpotsPerBooking'])) $this->MinNumberOfSpotsPerBooking = $o['MinNumberOfSpotsPerBooking'];
        if (isset($o['GroupBooking'])) $this->GroupBooking = JsonConverters::from('GroupBookingSettings', $o['GroupBooking']);
        if (isset($o['MultipleResource'])) $this->MultipleResource = JsonConverters::from('MultipleResourceSettings', $o['MultipleResource']);
        if (isset($o['IsGroupBooking'])) $this->IsGroupBooking = $o['IsGroupBooking'];
        if (isset($o['IsPaymentEnabled'])) $this->IsPaymentEnabled = $o['IsPaymentEnabled'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ImageUrl)) $o['ImageUrl'] = JsonConverters::to('string', $this->ImageUrl);
        if (isset($this->LengthInMinutes)) $o['LengthInMinutes'] = $this->LengthInMinutes;
        if (isset($this->MaxNumberOfSpotsPerBooking)) $o['MaxNumberOfSpotsPerBooking'] = $this->MaxNumberOfSpotsPerBooking;
        if (isset($this->MinNumberOfSpotsPerBooking)) $o['MinNumberOfSpotsPerBooking'] = $this->MinNumberOfSpotsPerBooking;
        if (isset($this->GroupBooking)) $o['GroupBooking'] = JsonConverters::to('GroupBookingSettings', $this->GroupBooking);
        if (isset($this->MultipleResource)) $o['MultipleResource'] = JsonConverters::to('MultipleResourceSettings', $this->MultipleResource);
        if (isset($this->IsGroupBooking)) $o['IsGroupBooking'] = $this->IsGroupBooking;
        if (isset($this->IsPaymentEnabled)) $o['IsPaymentEnabled'] = $this->IsPaymentEnabled;
        return empty($o) ? new class(){} : $o;
    }
}

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

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

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

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

        /** @description The price calculation type id, 1 = Normal, price is for the service total duration, 2 = Price is per minute, 3 = Price is per hour, 4= Price is per day */
        // @ApiMember(Description="The price calculation type id, 1 = Normal, price is for the service total duration, 2 = Price is per minute, 3 = Price is per hour, 4= Price is per day")
        /** @var int */
        public int $CalculationTypeId=0,

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

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

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

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

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

        /** @description The valid from date for the price. */
        // @ApiMember(Description="The valid from date for the price.")
        /** @var DateTime */
        public DateTime $From=new DateTime(),

        /** @description The valid to date for the price. */
        // @ApiMember(Description="The valid to date for the price.")
        /** @var DateTime */
        public DateTime $To=new DateTime(),

        /** @description If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update. */
        // @ApiMember(Description="If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.")
        /** @var array<DayOfWeekDto>|null */
        public ?array $DaysOfWeek=null,

        /** @description If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update. */
        // @ApiMember(Description="If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.")
        /** @var DateInterval|null */
        public ?DateInterval $FromTime=null,

        /** @description If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters. */
        // @ApiMember(Description="If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.")
        /** @var DateInterval|null */
        public ?DateInterval $ToTime=null,

        /** @var ServiceInfoResponse|null */
        public ?ServiceInfoResponse $Service=null,
        /** @description If the price is only valid for a specific time span */
        // @ApiMember(Description="If the price is only valid for a specific time span")
        /** @var bool|null */
        public ?bool $IsTimeSpecific=null,

        /** @description If the price is only valid for specific days of week */
        // @ApiMember(Description="If the price is only valid for specific days of week")
        /** @var bool|null */
        public ?bool $IsDaysOfWeekSpecific=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['ServiceId'])) $this->ServiceId = $o['ServiceId'];
        if (isset($o['Price'])) $this->Price = $o['Price'];
        if (isset($o['CalculationTypeId'])) $this->CalculationTypeId = $o['CalculationTypeId'];
        if (isset($o['CurrencyId'])) $this->CurrencyId = $o['CurrencyId'];
        if (isset($o['PriceSign'])) $this->PriceSign = $o['PriceSign'];
        if (isset($o['VAT'])) $this->VAT = $o['VAT'];
        if (isset($o['Category'])) $this->Category = $o['Category'];
        if (isset($o['PriceText'])) $this->PriceText = $o['PriceText'];
        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['DaysOfWeek'])) $this->DaysOfWeek = JsonConverters::fromArray('DayOfWeekDto', $o['DaysOfWeek']);
        if (isset($o['FromTime'])) $this->FromTime = JsonConverters::from('TimeSpan', $o['FromTime']);
        if (isset($o['ToTime'])) $this->ToTime = JsonConverters::from('TimeSpan', $o['ToTime']);
        if (isset($o['Service'])) $this->Service = JsonConverters::from('ServiceInfoResponse', $o['Service']);
        if (isset($o['IsTimeSpecific'])) $this->IsTimeSpecific = $o['IsTimeSpecific'];
        if (isset($o['IsDaysOfWeekSpecific'])) $this->IsDaysOfWeekSpecific = $o['IsDaysOfWeekSpecific'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->ServiceId)) $o['ServiceId'] = $this->ServiceId;
        if (isset($this->Price)) $o['Price'] = $this->Price;
        if (isset($this->CalculationTypeId)) $o['CalculationTypeId'] = $this->CalculationTypeId;
        if (isset($this->CurrencyId)) $o['CurrencyId'] = $this->CurrencyId;
        if (isset($this->PriceSign)) $o['PriceSign'] = $this->PriceSign;
        if (isset($this->VAT)) $o['VAT'] = $this->VAT;
        if (isset($this->Category)) $o['Category'] = $this->Category;
        if (isset($this->PriceText)) $o['PriceText'] = $this->PriceText;
        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->DaysOfWeek)) $o['DaysOfWeek'] = JsonConverters::toArray('DayOfWeekDto', $this->DaysOfWeek);
        if (isset($this->FromTime)) $o['FromTime'] = JsonConverters::to('TimeSpan', $this->FromTime);
        if (isset($this->ToTime)) $o['ToTime'] = JsonConverters::to('TimeSpan', $this->ToTime);
        if (isset($this->Service)) $o['Service'] = JsonConverters::to('ServiceInfoResponse', $this->Service);
        if (isset($this->IsTimeSpecific)) $o['IsTimeSpecific'] = $this->IsTimeSpecific;
        if (isset($this->IsDaysOfWeekSpecific)) $o['IsDaysOfWeekSpecific'] = $this->IsDaysOfWeekSpecific;
        return empty($o) ? new class(){} : $o;
    }
}

class BaseModel implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @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 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;
    }
}

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

interface IDbConnectionFactory
{
}

class ServerData implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $HTTP_HOST=null,
        /** @var string|null */
        public ?string $HTTP_CONNECTION=null,
        /** @var string|null */
        public ?string $HTTP_CACHE_CONTROL=null,
        /** @var string|null */
        public ?string $HTTP_ACCEPT=null,
        /** @var string|null */
        public ?string $HTTP_USER_AGENT=null,
        /** @var string|null */
        public ?string $HTTP_ACCEPT_ENCODING=null,
        /** @var string|null */
        public ?string $HTTP_ACCEPT_LANGUAGE=null,
        /** @var string|null */
        public ?string $PATH=null,
        /** @var string|null */
        public ?string $SERVER_SOFTWARE=null,
        /** @var string|null */
        public ?string $SERVER_NAME=null,
        /** @var string|null */
        public ?string $SERVER_ADDR=null,
        /** @var string|null */
        public ?string $SERVER_PORT=null,
        /** @var string|null */
        public ?string $REMOTE_ADDR=null,
        /** @var string|null */
        public ?string $REMOTE_PORT=null,
        /** @var string|null */
        public ?string $GATEWAY_INTERFACE=null,
        /** @var string|null */
        public ?string $SERVER_PROTOCOL=null,
        /** @var string|null */
        public ?string $REQUEST_METHOD=null,
        /** @var string|null */
        public ?string $QUERY_STRING=null,
        /** @var string|null */
        public ?string $REQUEST_TIME=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['HTTP_HOST'])) $this->HTTP_HOST = $o['HTTP_HOST'];
        if (isset($o['HTTP_CONNECTION'])) $this->HTTP_CONNECTION = $o['HTTP_CONNECTION'];
        if (isset($o['HTTP_CACHE_CONTROL'])) $this->HTTP_CACHE_CONTROL = $o['HTTP_CACHE_CONTROL'];
        if (isset($o['HTTP_ACCEPT'])) $this->HTTP_ACCEPT = $o['HTTP_ACCEPT'];
        if (isset($o['HTTP_USER_AGENT'])) $this->HTTP_USER_AGENT = $o['HTTP_USER_AGENT'];
        if (isset($o['HTTP_ACCEPT_ENCODING'])) $this->HTTP_ACCEPT_ENCODING = $o['HTTP_ACCEPT_ENCODING'];
        if (isset($o['HTTP_ACCEPT_LANGUAGE'])) $this->HTTP_ACCEPT_LANGUAGE = $o['HTTP_ACCEPT_LANGUAGE'];
        if (isset($o['PATH'])) $this->PATH = $o['PATH'];
        if (isset($o['SERVER_SOFTWARE'])) $this->SERVER_SOFTWARE = $o['SERVER_SOFTWARE'];
        if (isset($o['SERVER_NAME'])) $this->SERVER_NAME = $o['SERVER_NAME'];
        if (isset($o['SERVER_ADDR'])) $this->SERVER_ADDR = $o['SERVER_ADDR'];
        if (isset($o['SERVER_PORT'])) $this->SERVER_PORT = $o['SERVER_PORT'];
        if (isset($o['REMOTE_ADDR'])) $this->REMOTE_ADDR = $o['REMOTE_ADDR'];
        if (isset($o['REMOTE_PORT'])) $this->REMOTE_PORT = $o['REMOTE_PORT'];
        if (isset($o['GATEWAY_INTERFACE'])) $this->GATEWAY_INTERFACE = $o['GATEWAY_INTERFACE'];
        if (isset($o['SERVER_PROTOCOL'])) $this->SERVER_PROTOCOL = $o['SERVER_PROTOCOL'];
        if (isset($o['REQUEST_METHOD'])) $this->REQUEST_METHOD = $o['REQUEST_METHOD'];
        if (isset($o['QUERY_STRING'])) $this->QUERY_STRING = $o['QUERY_STRING'];
        if (isset($o['REQUEST_TIME'])) $this->REQUEST_TIME = $o['REQUEST_TIME'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->HTTP_HOST)) $o['HTTP_HOST'] = $this->HTTP_HOST;
        if (isset($this->HTTP_CONNECTION)) $o['HTTP_CONNECTION'] = $this->HTTP_CONNECTION;
        if (isset($this->HTTP_CACHE_CONTROL)) $o['HTTP_CACHE_CONTROL'] = $this->HTTP_CACHE_CONTROL;
        if (isset($this->HTTP_ACCEPT)) $o['HTTP_ACCEPT'] = $this->HTTP_ACCEPT;
        if (isset($this->HTTP_USER_AGENT)) $o['HTTP_USER_AGENT'] = $this->HTTP_USER_AGENT;
        if (isset($this->HTTP_ACCEPT_ENCODING)) $o['HTTP_ACCEPT_ENCODING'] = $this->HTTP_ACCEPT_ENCODING;
        if (isset($this->HTTP_ACCEPT_LANGUAGE)) $o['HTTP_ACCEPT_LANGUAGE'] = $this->HTTP_ACCEPT_LANGUAGE;
        if (isset($this->PATH)) $o['PATH'] = $this->PATH;
        if (isset($this->SERVER_SOFTWARE)) $o['SERVER_SOFTWARE'] = $this->SERVER_SOFTWARE;
        if (isset($this->SERVER_NAME)) $o['SERVER_NAME'] = $this->SERVER_NAME;
        if (isset($this->SERVER_ADDR)) $o['SERVER_ADDR'] = $this->SERVER_ADDR;
        if (isset($this->SERVER_PORT)) $o['SERVER_PORT'] = $this->SERVER_PORT;
        if (isset($this->REMOTE_ADDR)) $o['REMOTE_ADDR'] = $this->REMOTE_ADDR;
        if (isset($this->REMOTE_PORT)) $o['REMOTE_PORT'] = $this->REMOTE_PORT;
        if (isset($this->GATEWAY_INTERFACE)) $o['GATEWAY_INTERFACE'] = $this->GATEWAY_INTERFACE;
        if (isset($this->SERVER_PROTOCOL)) $o['SERVER_PROTOCOL'] = $this->SERVER_PROTOCOL;
        if (isset($this->REQUEST_METHOD)) $o['REQUEST_METHOD'] = $this->REQUEST_METHOD;
        if (isset($this->QUERY_STRING)) $o['QUERY_STRING'] = $this->QUERY_STRING;
        if (isset($this->REQUEST_TIME)) $o['REQUEST_TIME'] = $this->REQUEST_TIME;
        return empty($o) ? new class(){} : $o;
    }
}

class Credentials implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $hash=null,
        /** @var string|null */
        public ?string $id=null,
        /** @var string|null */
        public ?string $version=null,
        /** @var string|null */
        public ?string $client=null,
        /** @var ServerData|null */
        public ?ServerData $serverdata=null,
        /** @var string|null */
        public ?string $time=null,
        /** @var string|null */
        public ?string $test=null,
        /** @var string|null */
        public ?string $language=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['hash'])) $this->hash = $o['hash'];
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['version'])) $this->version = $o['version'];
        if (isset($o['client'])) $this->client = $o['client'];
        if (isset($o['serverdata'])) $this->serverdata = JsonConverters::from('ServerData', $o['serverdata']);
        if (isset($o['time'])) $this->time = $o['time'];
        if (isset($o['test'])) $this->test = $o['test'];
        if (isset($o['language'])) $this->language = $o['language'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->hash)) $o['hash'] = $this->hash;
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->version)) $o['version'] = $this->version;
        if (isset($this->client)) $o['client'] = $this->client;
        if (isset($this->serverdata)) $o['serverdata'] = JsonConverters::to('ServerData', $this->serverdata);
        if (isset($this->time)) $o['time'] = $this->time;
        if (isset($this->test)) $o['test'] = $this->test;
        if (isset($this->language)) $o['language'] = $this->language;
        return empty($o) ? new class(){} : $o;
    }
}

class CheckoutData implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $terms=null,
        /** @var string|null */
        public ?string $privacyPolicy=null,
        /** @var string|null */
        public ?string $redirectOnSuccess=null
    ) {
    }

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

class CheckoutPaymentData implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $currency=null,
        /** @var string|null */
        public ?string $language=null,
        /** @var string|null */
        public ?string $country=null,
        /** @var string|null */
        public ?string $autoactivate=null,
        /** @var string|null */
        public ?string $orderid=null,
        /** @var string|null */
        public ?string $returnmethod=null,
        /** @var string|null */
        public ?string $accepturl=null,
        /** @var string|null */
        public ?string $cancelurl=null,
        /** @var string|null */
        public ?string $callbackurl=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['currency'])) $this->currency = $o['currency'];
        if (isset($o['language'])) $this->language = $o['language'];
        if (isset($o['country'])) $this->country = $o['country'];
        if (isset($o['autoactivate'])) $this->autoactivate = $o['autoactivate'];
        if (isset($o['orderid'])) $this->orderid = $o['orderid'];
        if (isset($o['returnmethod'])) $this->returnmethod = $o['returnmethod'];
        if (isset($o['accepturl'])) $this->accepturl = JsonConverters::from('string', $o['accepturl']);
        if (isset($o['cancelurl'])) $this->cancelurl = JsonConverters::from('string', $o['cancelurl']);
        if (isset($o['callbackurl'])) $this->callbackurl = JsonConverters::from('string', $o['callbackurl']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->currency)) $o['currency'] = $this->currency;
        if (isset($this->language)) $o['language'] = $this->language;
        if (isset($this->country)) $o['country'] = $this->country;
        if (isset($this->autoactivate)) $o['autoactivate'] = $this->autoactivate;
        if (isset($this->orderid)) $o['orderid'] = $this->orderid;
        if (isset($this->returnmethod)) $o['returnmethod'] = $this->returnmethod;
        if (isset($this->accepturl)) $o['accepturl'] = JsonConverters::to('string', $this->accepturl);
        if (isset($this->cancelurl)) $o['cancelurl'] = JsonConverters::to('string', $this->cancelurl);
        if (isset($this->callbackurl)) $o['callbackurl'] = JsonConverters::to('string', $this->callbackurl);
        return empty($o) ? new class(){} : $o;
    }
}

class PaymentInfo implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $paymentdate=null,
        /** @var string|null */
        public ?string $paymentterms=null,
        /** @var string|null */
        public ?string $yourreference=null,
        /** @var string|null */
        public ?string $ourreference=null,
        /** @var string|null */
        public ?string $projectname=null,
        /** @var string|null */
        public ?string $deliverymethod=null,
        /** @var string|null */
        public ?string $deliveryterms=null
    ) {
    }

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

class CartHandling implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $withouttax=null,
        /** @var string|null */
        public ?string $taxrate=null
    ) {
    }

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

class CartTotal implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $rounding=null,
        /** @var string|null */
        public ?string $withouttax=null,
        /** @var string|null */
        public ?string $tax=null,
        /** @var string|null */
        public ?string $withtax=null
    ) {
    }

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

class Shipping implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $firstname=null,
        /** @var string|null */
        public ?string $lastname=null,
        /** @var string|null */
        public ?string $company=null,
        /** @var string|null */
        public ?string $street=null,
        /** @var string|null */
        public ?string $street2=null,
        /** @var string|null */
        public ?string $zip=null,
        /** @var string|null */
        public ?string $city=null,
        /** @var string|null */
        public ?string $country=null,
        /** @var string|null */
        public ?string $phone=null,
        /** @var string|null */
        public ?string $withouttax=null,
        /** @var string|null */
        public ?string $taxrate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['firstname'])) $this->firstname = $o['firstname'];
        if (isset($o['lastname'])) $this->lastname = $o['lastname'];
        if (isset($o['company'])) $this->company = $o['company'];
        if (isset($o['street'])) $this->street = $o['street'];
        if (isset($o['street2'])) $this->street2 = $o['street2'];
        if (isset($o['zip'])) $this->zip = $o['zip'];
        if (isset($o['city'])) $this->city = $o['city'];
        if (isset($o['country'])) $this->country = $o['country'];
        if (isset($o['phone'])) $this->phone = $o['phone'];
        if (isset($o['withouttax'])) $this->withouttax = $o['withouttax'];
        if (isset($o['taxrate'])) $this->taxrate = $o['taxrate'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->firstname)) $o['firstname'] = $this->firstname;
        if (isset($this->lastname)) $o['lastname'] = $this->lastname;
        if (isset($this->company)) $o['company'] = $this->company;
        if (isset($this->street)) $o['street'] = $this->street;
        if (isset($this->street2)) $o['street2'] = $this->street2;
        if (isset($this->zip)) $o['zip'] = $this->zip;
        if (isset($this->city)) $o['city'] = $this->city;
        if (isset($this->country)) $o['country'] = $this->country;
        if (isset($this->phone)) $o['phone'] = $this->phone;
        if (isset($this->withouttax)) $o['withouttax'] = $this->withouttax;
        if (isset($this->taxrate)) $o['taxrate'] = $this->taxrate;
        return empty($o) ? new class(){} : $o;
    }
}

class Cart implements JsonSerializable
{
    public function __construct(
        /** @var CartHandling|null */
        public ?CartHandling $Handling=null,
        /** @var CartTotal|null */
        public ?CartTotal $Total=null,
        /** @var Shipping|null */
        public ?Shipping $Shipping=null
    ) {
    }

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

class CustomerBilling implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $firstname=null,
        /** @var string|null */
        public ?string $lastname=null,
        /** @var string|null */
        public ?string $company=null,
        /** @var string|null */
        public ?string $street=null,
        /** @var string|null */
        public ?string $street2=null,
        /** @var string|null */
        public ?string $zip=null,
        /** @var string|null */
        public ?string $city=null,
        /** @var string|null */
        public ?string $country=null,
        /** @var string|null */
        public ?string $phone=null,
        /** @var string|null */
        public ?string $email=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['firstname'])) $this->firstname = $o['firstname'];
        if (isset($o['lastname'])) $this->lastname = $o['lastname'];
        if (isset($o['company'])) $this->company = $o['company'];
        if (isset($o['street'])) $this->street = $o['street'];
        if (isset($o['street2'])) $this->street2 = $o['street2'];
        if (isset($o['zip'])) $this->zip = $o['zip'];
        if (isset($o['city'])) $this->city = $o['city'];
        if (isset($o['country'])) $this->country = $o['country'];
        if (isset($o['phone'])) $this->phone = $o['phone'];
        if (isset($o['email'])) $this->email = $o['email'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->firstname)) $o['firstname'] = $this->firstname;
        if (isset($this->lastname)) $o['lastname'] = $this->lastname;
        if (isset($this->company)) $o['company'] = $this->company;
        if (isset($this->street)) $o['street'] = $this->street;
        if (isset($this->street2)) $o['street2'] = $this->street2;
        if (isset($this->zip)) $o['zip'] = $this->zip;
        if (isset($this->city)) $o['city'] = $this->city;
        if (isset($this->country)) $o['country'] = $this->country;
        if (isset($this->phone)) $o['phone'] = $this->phone;
        if (isset($this->email)) $o['email'] = $this->email;
        return empty($o) ? new class(){} : $o;
    }
}

class QvicklyCustomer implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $nr=null,
        /** @var string|null */
        public ?string $pno=null,
        /** @var CustomerBilling|null */
        public ?CustomerBilling $Billing=null
    ) {
    }

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

class InitCheckoutData implements JsonSerializable
{
    public function __construct(
        /** @var CheckoutData|null */
        public ?CheckoutData $CheckoutData=null,
        /** @var CheckoutPaymentData|null */
        public ?CheckoutPaymentData $PaymentData=null,
        /** @var PaymentInfo|null */
        public ?PaymentInfo $PaymentInfo=null,
        /** @var QvicklyArticle[]|null */
        public ?array $Articles=null,
        /** @var Cart|null */
        public ?Cart $Cart=null,
        /** @var QvicklyCustomer|null */
        public ?QvicklyCustomer $QvicklyCustomer=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CheckoutData'])) $this->CheckoutData = JsonConverters::from('CheckoutData', $o['CheckoutData']);
        if (isset($o['PaymentData'])) $this->PaymentData = JsonConverters::from('CheckoutPaymentData', $o['PaymentData']);
        if (isset($o['PaymentInfo'])) $this->PaymentInfo = JsonConverters::from('PaymentInfo', $o['PaymentInfo']);
        if (isset($o['Articles'])) $this->Articles = JsonConverters::fromArray('QvicklyArticle', $o['Articles']);
        if (isset($o['Cart'])) $this->Cart = JsonConverters::from('Cart', $o['Cart']);
        if (isset($o['QvicklyCustomer'])) $this->QvicklyCustomer = JsonConverters::from('QvicklyCustomer', $o['QvicklyCustomer']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CheckoutData)) $o['CheckoutData'] = JsonConverters::to('CheckoutData', $this->CheckoutData);
        if (isset($this->PaymentData)) $o['PaymentData'] = JsonConverters::to('CheckoutPaymentData', $this->PaymentData);
        if (isset($this->PaymentInfo)) $o['PaymentInfo'] = JsonConverters::to('PaymentInfo', $this->PaymentInfo);
        if (isset($this->Articles)) $o['Articles'] = JsonConverters::toArray('QvicklyArticle', $this->Articles);
        if (isset($this->Cart)) $o['Cart'] = JsonConverters::to('Cart', $this->Cart);
        if (isset($this->QvicklyCustomer)) $o['QvicklyCustomer'] = JsonConverters::to('QvicklyCustomer', $this->QvicklyCustomer);
        return empty($o) ? new class(){} : $o;
    }
}

class InitCheckoutRequestBody implements JsonSerializable
{
    public function __construct(
        /** @var Credentials|null */
        public ?Credentials $credentials=null,
        /** @var InitCheckoutData|null */
        public ?InitCheckoutData $data=null,
        /** @var string|null */
        public ?string $function=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['credentials'])) $this->credentials = JsonConverters::from('Credentials', $o['credentials']);
        if (isset($o['data'])) $this->data = JsonConverters::from('InitCheckoutData', $o['data']);
        if (isset($o['function'])) $this->function = $o['function'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->credentials)) $o['credentials'] = JsonConverters::to('Credentials', $this->credentials);
        if (isset($this->data)) $o['data'] = JsonConverters::to('InitCheckoutData', $this->data);
        if (isset($this->function)) $o['function'] = $this->function;
        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;
    }
}

class QvikclyPaymentData implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $method=null,
        /** @var string|null */
        public ?string $paymentplanid=null,
        /** @var string|null */
        public ?string $currency=null,
        /** @var string|null */
        public ?string $country=null,
        /** @var string|null */
        public ?string $language=null,
        /** @var string|null */
        public ?string $autoactivate=null,
        /** @var string|null */
        public ?string $orderid=null,
        /** @var string|null */
        public ?string $status=null,
        /** @var string|null */
        public ?string $paymentid_related=null,
        /** @var string|null */
        public ?string $url=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['method'])) $this->method = $o['method'];
        if (isset($o['paymentplanid'])) $this->paymentplanid = $o['paymentplanid'];
        if (isset($o['currency'])) $this->currency = $o['currency'];
        if (isset($o['country'])) $this->country = $o['country'];
        if (isset($o['language'])) $this->language = $o['language'];
        if (isset($o['autoactivate'])) $this->autoactivate = $o['autoactivate'];
        if (isset($o['orderid'])) $this->orderid = $o['orderid'];
        if (isset($o['status'])) $this->status = $o['status'];
        if (isset($o['paymentid_related'])) $this->paymentid_related = $o['paymentid_related'];
        if (isset($o['url'])) $this->url = $o['url'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->method)) $o['method'] = $this->method;
        if (isset($this->paymentplanid)) $o['paymentplanid'] = $this->paymentplanid;
        if (isset($this->currency)) $o['currency'] = $this->currency;
        if (isset($this->country)) $o['country'] = $this->country;
        if (isset($this->language)) $o['language'] = $this->language;
        if (isset($this->autoactivate)) $o['autoactivate'] = $this->autoactivate;
        if (isset($this->orderid)) $o['orderid'] = $this->orderid;
        if (isset($this->status)) $o['status'] = $this->status;
        if (isset($this->paymentid_related)) $o['paymentid_related'] = $this->paymentid_related;
        if (isset($this->url)) $o['url'] = $this->url;
        return empty($o) ? new class(){} : $o;
    }
}

class Card implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $promptname=null,
        /** @var string|null */
        public ?string $recurring=null,
        /** @var string|null */
        public ?string $recurringnr=null,
        /** @var string|null */
        public ?string $accepturl=null,
        /** @var string|null */
        public ?string $cancelurl=null,
        /** @var string|null */
        public ?string $callbackurl=null,
        /** @var string|null */
        public ?string $returnmethod=null
    ) {
    }

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

class Settlement implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $number=null,
        /** @var string|null */
        public ?string $date=null
    ) {
    }

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

class QvicklyPaymentResponse implements JsonSerializable
{
    public function __construct(
        /** @var QvikclyPaymentData|null */
        public ?QvikclyPaymentData $PaymentData=null,
        /** @var PaymentInfo|null */
        public ?PaymentInfo $PaymentInfo=null,
        /** @var Card|null */
        public ?Card $Card=null,
        /** @var Settlement|null */
        public ?Settlement $Settlement=null,
        /** @var QvicklyCustomer|null */
        public ?QvicklyCustomer $QvicklyCustomer=null,
        /** @var QvicklyArticle[]|null */
        public ?array $Articles=null,
        /** @var Cart|null */
        public ?Cart $Cart=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['PaymentData'])) $this->PaymentData = JsonConverters::from('QvikclyPaymentData', $o['PaymentData']);
        if (isset($o['PaymentInfo'])) $this->PaymentInfo = JsonConverters::from('PaymentInfo', $o['PaymentInfo']);
        if (isset($o['Card'])) $this->Card = JsonConverters::from('Card', $o['Card']);
        if (isset($o['Settlement'])) $this->Settlement = JsonConverters::from('Settlement', $o['Settlement']);
        if (isset($o['QvicklyCustomer'])) $this->QvicklyCustomer = JsonConverters::from('QvicklyCustomer', $o['QvicklyCustomer']);
        if (isset($o['Articles'])) $this->Articles = JsonConverters::fromArray('QvicklyArticle', $o['Articles']);
        if (isset($o['Cart'])) $this->Cart = JsonConverters::from('Cart', $o['Cart']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->PaymentData)) $o['PaymentData'] = JsonConverters::to('QvikclyPaymentData', $this->PaymentData);
        if (isset($this->PaymentInfo)) $o['PaymentInfo'] = JsonConverters::to('PaymentInfo', $this->PaymentInfo);
        if (isset($this->Card)) $o['Card'] = JsonConverters::to('Card', $this->Card);
        if (isset($this->Settlement)) $o['Settlement'] = JsonConverters::to('Settlement', $this->Settlement);
        if (isset($this->QvicklyCustomer)) $o['QvicklyCustomer'] = JsonConverters::to('QvicklyCustomer', $this->QvicklyCustomer);
        if (isset($this->Articles)) $o['Articles'] = JsonConverters::toArray('QvicklyArticle', $this->Articles);
        if (isset($this->Cart)) $o['Cart'] = JsonConverters::to('Cart', $this->Cart);
        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 CustomerType : string
{
    case Person = 'Person';
    case Business = 'Business';
}

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

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

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 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 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 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 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 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 bool|null */
        public ?bool $ShowSubscribeToNewsletter=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['ShowSubscribeToNewsletter'])) $this->ShowSubscribeToNewsletter = $o['ShowSubscribeToNewsletter'];
        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->ShowSubscribeToNewsletter)) $o['ShowSubscribeToNewsletter'] = $this->ShowSubscribeToNewsletter;
        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,

        // @Ignore()
        /** @var LicenseType|null */
        public ?LicenseType $LicenseType=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['LicenseType'])) $this->LicenseType = JsonConverters::from('LicenseType', $o['LicenseType']);
        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->LicenseType)) $o['LicenseType'] = JsonConverters::to('LicenseType', $this->LicenseType);
        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 bool|null */
        public ?bool $Active=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['Active'])) $this->Active = $o['Active'];
        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->Active)) $o['Active'] = $this->Active;
        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 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;
    }
}

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 Company|null */
        public ?Company $Company=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,

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

        /** @var string|null */
        public ?string $Firstname=null,
        // @Ignore()
        /** @var string|null */
        public ?string $FullName=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['Company'])) $this->Company = JsonConverters::from('Company', $o['Company']);
        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['RebateCodes'])) $this->RebateCodes = JsonConverters::fromArray('RebateCode', $o['RebateCodes']);
        if (isset($o['Firstname'])) $this->Firstname = $o['Firstname'];
        if (isset($o['FullName'])) $this->FullName = $o['FullName'];
        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->Company)) $o['Company'] = JsonConverters::to('Company', $this->Company);
        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->RebateCodes)) $o['RebateCodes'] = JsonConverters::toArray('RebateCode', $this->RebateCodes);
        if (isset($this->Firstname)) $o['Firstname'] = $this->Firstname;
        if (isset($this->FullName)) $o['FullName'] = $this->FullName;
        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;
    }
}

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 BaseOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var array<string>|null */
        public ?array $Expand=null,
        /** @var array<string,Object>|null */
        public ?array $ExtraParams=null
    ) {
    }

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

class SessionAfterExpirationRecoveryOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $AllowPromotionCodes=null,
        /** @var bool|null */
        public ?bool $Enabled=null
    ) {
    }

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

class SessionAfterExpirationOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var SessionAfterExpirationRecoveryOptions|null */
        public ?SessionAfterExpirationRecoveryOptions $Recovery=null
    ) {
    }

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

class SessionAutomaticTaxLiabilityOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Account=null,
        /** @var string|null */
        public ?string $Type=null
    ) {
    }

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

class SessionAutomaticTaxOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Enabled=null,
        /** @var SessionAutomaticTaxLiabilityOptions|null */
        public ?SessionAutomaticTaxLiabilityOptions $Liability=null
    ) {
    }

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

class SessionConsentCollectionPaymentMethodReuseAgreementOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Position=null
    ) {
    }

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

class SessionConsentCollectionOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var SessionConsentCollectionPaymentMethodReuseAgreementOptions|null */
        public ?SessionConsentCollectionPaymentMethodReuseAgreementOptions $PaymentMethodReuseAgreement=null,
        /** @var string|null */
        public ?string $Promotions=null,
        /** @var string|null */
        public ?string $TermsOfService=null
    ) {
    }

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

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

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

class SessionCustomFieldDropdownOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $DefaultValue=null,
        /** @var array<SessionCustomFieldDropdownOptionOptions>|null */
        public ?array $Options=null
    ) {
    }

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

class SessionCustomFieldLabelOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Custom=null,
        /** @var string|null */
        public ?string $Type=null
    ) {
    }

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

class SessionCustomFieldNumericOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $DefaultValue=null,
        /** @var int|null */
        public ?int $MaximumLength=null,
        /** @var int|null */
        public ?int $MinimumLength=null
    ) {
    }

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

class SessionCustomFieldTextOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $DefaultValue=null,
        /** @var int|null */
        public ?int $MaximumLength=null,
        /** @var int|null */
        public ?int $MinimumLength=null
    ) {
    }

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

class SessionCustomFieldOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var SessionCustomFieldDropdownOptions|null */
        public ?SessionCustomFieldDropdownOptions $Dropdown=null,
        /** @var string|null */
        public ?string $Key=null,
        /** @var SessionCustomFieldLabelOptions|null */
        public ?SessionCustomFieldLabelOptions $Label=null,
        /** @var SessionCustomFieldNumericOptions|null */
        public ?SessionCustomFieldNumericOptions $Numeric=null,
        /** @var bool|null */
        public ?bool $Optional=null,
        /** @var SessionCustomFieldTextOptions|null */
        public ?SessionCustomFieldTextOptions $Text=null,
        /** @var string|null */
        public ?string $Type=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Dropdown'])) $this->Dropdown = JsonConverters::from('SessionCustomFieldDropdownOptions', $o['Dropdown']);
        if (isset($o['Key'])) $this->Key = $o['Key'];
        if (isset($o['Label'])) $this->Label = JsonConverters::from('SessionCustomFieldLabelOptions', $o['Label']);
        if (isset($o['Numeric'])) $this->Numeric = JsonConverters::from('SessionCustomFieldNumericOptions', $o['Numeric']);
        if (isset($o['Optional'])) $this->Optional = $o['Optional'];
        if (isset($o['Text'])) $this->Text = JsonConverters::from('SessionCustomFieldTextOptions', $o['Text']);
        if (isset($o['Type'])) $this->Type = $o['Type'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Dropdown)) $o['Dropdown'] = JsonConverters::to('SessionCustomFieldDropdownOptions', $this->Dropdown);
        if (isset($this->Key)) $o['Key'] = $this->Key;
        if (isset($this->Label)) $o['Label'] = JsonConverters::to('SessionCustomFieldLabelOptions', $this->Label);
        if (isset($this->Numeric)) $o['Numeric'] = JsonConverters::to('SessionCustomFieldNumericOptions', $this->Numeric);
        if (isset($this->Optional)) $o['Optional'] = $this->Optional;
        if (isset($this->Text)) $o['Text'] = JsonConverters::to('SessionCustomFieldTextOptions', $this->Text);
        if (isset($this->Type)) $o['Type'] = $this->Type;
        return empty($o) ? new class(){} : $o;
    }
}

class SessionCustomTextAfterSubmitOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Message=null
    ) {
    }

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

class SessionCustomTextShippingAddressOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Message=null
    ) {
    }

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

class SessionCustomTextSubmitOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Message=null
    ) {
    }

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

class SessionCustomTextTermsOfServiceAcceptanceOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Message=null
    ) {
    }

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

class SessionCustomTextOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var SessionCustomTextAfterSubmitOptions|null */
        public ?SessionCustomTextAfterSubmitOptions $AfterSubmit=null,
        /** @var SessionCustomTextShippingAddressOptions|null */
        public ?SessionCustomTextShippingAddressOptions $ShippingAddress=null,
        /** @var SessionCustomTextSubmitOptions|null */
        public ?SessionCustomTextSubmitOptions $Submit=null,
        /** @var SessionCustomTextTermsOfServiceAcceptanceOptions|null */
        public ?SessionCustomTextTermsOfServiceAcceptanceOptions $TermsOfServiceAcceptance=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AfterSubmit'])) $this->AfterSubmit = JsonConverters::from('SessionCustomTextAfterSubmitOptions', $o['AfterSubmit']);
        if (isset($o['ShippingAddress'])) $this->ShippingAddress = JsonConverters::from('SessionCustomTextShippingAddressOptions', $o['ShippingAddress']);
        if (isset($o['Submit'])) $this->Submit = JsonConverters::from('SessionCustomTextSubmitOptions', $o['Submit']);
        if (isset($o['TermsOfServiceAcceptance'])) $this->TermsOfServiceAcceptance = JsonConverters::from('SessionCustomTextTermsOfServiceAcceptanceOptions', $o['TermsOfServiceAcceptance']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->AfterSubmit)) $o['AfterSubmit'] = JsonConverters::to('SessionCustomTextAfterSubmitOptions', $this->AfterSubmit);
        if (isset($this->ShippingAddress)) $o['ShippingAddress'] = JsonConverters::to('SessionCustomTextShippingAddressOptions', $this->ShippingAddress);
        if (isset($this->Submit)) $o['Submit'] = JsonConverters::to('SessionCustomTextSubmitOptions', $this->Submit);
        if (isset($this->TermsOfServiceAcceptance)) $o['TermsOfServiceAcceptance'] = JsonConverters::to('SessionCustomTextTermsOfServiceAcceptanceOptions', $this->TermsOfServiceAcceptance);
        return empty($o) ? new class(){} : $o;
    }
}

class SessionCustomerUpdateOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Address=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Shipping=null
    ) {
    }

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

class SessionDiscountOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Coupon=null,
        /** @var string|null */
        public ?string $PromotionCode=null
    ) {
    }

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

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

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

class SessionInvoiceCreationInvoiceDataIssuerOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Account=null,
        /** @var string|null */
        public ?string $Type=null
    ) {
    }

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

class SessionInvoiceCreationInvoiceDataRenderingOptionsOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $AmountTaxDisplay=null
    ) {
    }

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

class SessionInvoiceCreationInvoiceDataOptions implements INestedOptions, IHasMetadata, JsonSerializable
{
    public function __construct(
        /** @var array<string>|null */
        public ?array $AccountTaxIds=null,
        /** @var array<SessionInvoiceCreationInvoiceDataCustomFieldOptions>|null */
        public ?array $CustomFields=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $Footer=null,
        /** @var SessionInvoiceCreationInvoiceDataIssuerOptions|null */
        public ?SessionInvoiceCreationInvoiceDataIssuerOptions $Issuer=null,
        /** @var array<string,string>|null */
        public ?array $Metadata=null,
        /** @var SessionInvoiceCreationInvoiceDataRenderingOptionsOptions|null */
        public ?SessionInvoiceCreationInvoiceDataRenderingOptionsOptions $RenderingOptions=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AccountTaxIds'])) $this->AccountTaxIds = JsonConverters::fromArray('string', $o['AccountTaxIds']);
        if (isset($o['CustomFields'])) $this->CustomFields = JsonConverters::fromArray('SessionInvoiceCreationInvoiceDataCustomFieldOptions', $o['CustomFields']);
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Footer'])) $this->Footer = $o['Footer'];
        if (isset($o['Issuer'])) $this->Issuer = JsonConverters::from('SessionInvoiceCreationInvoiceDataIssuerOptions', $o['Issuer']);
        if (isset($o['Metadata'])) $this->Metadata = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Metadata']);
        if (isset($o['RenderingOptions'])) $this->RenderingOptions = JsonConverters::from('SessionInvoiceCreationInvoiceDataRenderingOptionsOptions', $o['RenderingOptions']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->AccountTaxIds)) $o['AccountTaxIds'] = JsonConverters::toArray('string', $this->AccountTaxIds);
        if (isset($this->CustomFields)) $o['CustomFields'] = JsonConverters::toArray('SessionInvoiceCreationInvoiceDataCustomFieldOptions', $this->CustomFields);
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Footer)) $o['Footer'] = $this->Footer;
        if (isset($this->Issuer)) $o['Issuer'] = JsonConverters::to('SessionInvoiceCreationInvoiceDataIssuerOptions', $this->Issuer);
        if (isset($this->Metadata)) $o['Metadata'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Metadata);
        if (isset($this->RenderingOptions)) $o['RenderingOptions'] = JsonConverters::to('SessionInvoiceCreationInvoiceDataRenderingOptionsOptions', $this->RenderingOptions);
        return empty($o) ? new class(){} : $o;
    }
}

class SessionInvoiceCreationOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Enabled=null,
        /** @var SessionInvoiceCreationInvoiceDataOptions|null */
        public ?SessionInvoiceCreationInvoiceDataOptions $InvoiceData=null
    ) {
    }

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

class SessionLineItemAdjustableQuantityOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Enabled=null,
        /** @var int|null */
        public ?int $Maximum=null,
        /** @var int|null */
        public ?int $Minimum=null
    ) {
    }

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

class SessionLineItemPriceDataProductDataOptions implements INestedOptions, IHasMetadata, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Description=null,
        /** @var array<string>|null */
        public ?array $Images=null,
        /** @var array<string,string>|null */
        public ?array $Metadata=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $TaxCode=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Images'])) $this->Images = JsonConverters::fromArray('string', $o['Images']);
        if (isset($o['Metadata'])) $this->Metadata = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Metadata']);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['TaxCode'])) $this->TaxCode = $o['TaxCode'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Images)) $o['Images'] = JsonConverters::toArray('string', $this->Images);
        if (isset($this->Metadata)) $o['Metadata'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Metadata);
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->TaxCode)) $o['TaxCode'] = $this->TaxCode;
        return empty($o) ? new class(){} : $o;
    }
}

class SessionLineItemPriceDataRecurringOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Interval=null,
        /** @var int|null */
        public ?int $IntervalCount=null
    ) {
    }

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

class SessionLineItemPriceDataOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Currency=null,
        /** @var string|null */
        public ?string $Product=null,
        /** @var SessionLineItemPriceDataProductDataOptions|null */
        public ?SessionLineItemPriceDataProductDataOptions $ProductData=null,
        /** @var SessionLineItemPriceDataRecurringOptions|null */
        public ?SessionLineItemPriceDataRecurringOptions $Recurring=null,
        /** @var string|null */
        public ?string $TaxBehavior=null,
        /** @var int|null */
        public ?int $UnitAmount=null,
        /** @var float|null */
        public ?float $UnitAmountDecimal=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Currency'])) $this->Currency = $o['Currency'];
        if (isset($o['Product'])) $this->Product = $o['Product'];
        if (isset($o['ProductData'])) $this->ProductData = JsonConverters::from('SessionLineItemPriceDataProductDataOptions', $o['ProductData']);
        if (isset($o['Recurring'])) $this->Recurring = JsonConverters::from('SessionLineItemPriceDataRecurringOptions', $o['Recurring']);
        if (isset($o['TaxBehavior'])) $this->TaxBehavior = $o['TaxBehavior'];
        if (isset($o['UnitAmount'])) $this->UnitAmount = $o['UnitAmount'];
        if (isset($o['UnitAmountDecimal'])) $this->UnitAmountDecimal = $o['UnitAmountDecimal'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Currency)) $o['Currency'] = $this->Currency;
        if (isset($this->Product)) $o['Product'] = $this->Product;
        if (isset($this->ProductData)) $o['ProductData'] = JsonConverters::to('SessionLineItemPriceDataProductDataOptions', $this->ProductData);
        if (isset($this->Recurring)) $o['Recurring'] = JsonConverters::to('SessionLineItemPriceDataRecurringOptions', $this->Recurring);
        if (isset($this->TaxBehavior)) $o['TaxBehavior'] = $this->TaxBehavior;
        if (isset($this->UnitAmount)) $o['UnitAmount'] = $this->UnitAmount;
        if (isset($this->UnitAmountDecimal)) $o['UnitAmountDecimal'] = $this->UnitAmountDecimal;
        return empty($o) ? new class(){} : $o;
    }
}

class SessionLineItemOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var SessionLineItemAdjustableQuantityOptions|null */
        public ?SessionLineItemAdjustableQuantityOptions $AdjustableQuantity=null,
        /** @var array<string>|null */
        public ?array $DynamicTaxRates=null,
        /** @var string|null */
        public ?string $Price=null,
        /** @var SessionLineItemPriceDataOptions|null */
        public ?SessionLineItemPriceDataOptions $PriceData=null,
        /** @var int|null */
        public ?int $Quantity=null,
        /** @var array<string>|null */
        public ?array $TaxRates=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AdjustableQuantity'])) $this->AdjustableQuantity = JsonConverters::from('SessionLineItemAdjustableQuantityOptions', $o['AdjustableQuantity']);
        if (isset($o['DynamicTaxRates'])) $this->DynamicTaxRates = JsonConverters::fromArray('string', $o['DynamicTaxRates']);
        if (isset($o['Price'])) $this->Price = $o['Price'];
        if (isset($o['PriceData'])) $this->PriceData = JsonConverters::from('SessionLineItemPriceDataOptions', $o['PriceData']);
        if (isset($o['Quantity'])) $this->Quantity = $o['Quantity'];
        if (isset($o['TaxRates'])) $this->TaxRates = JsonConverters::fromArray('string', $o['TaxRates']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->AdjustableQuantity)) $o['AdjustableQuantity'] = JsonConverters::to('SessionLineItemAdjustableQuantityOptions', $this->AdjustableQuantity);
        if (isset($this->DynamicTaxRates)) $o['DynamicTaxRates'] = JsonConverters::toArray('string', $this->DynamicTaxRates);
        if (isset($this->Price)) $o['Price'] = $this->Price;
        if (isset($this->PriceData)) $o['PriceData'] = JsonConverters::to('SessionLineItemPriceDataOptions', $this->PriceData);
        if (isset($this->Quantity)) $o['Quantity'] = $this->Quantity;
        if (isset($this->TaxRates)) $o['TaxRates'] = JsonConverters::toArray('string', $this->TaxRates);
        return empty($o) ? new class(){} : $o;
    }
}

class AddressOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $City=null,
        /** @var string|null */
        public ?string $Country=null,
        /** @var string|null */
        public ?string $Line1=null,
        /** @var string|null */
        public ?string $Line2=null,
        /** @var string|null */
        public ?string $PostalCode=null,
        /** @var string|null */
        public ?string $State=null
    ) {
    }

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

class ChargeShippingOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var AddressOptions|null */
        public ?AddressOptions $Address=null,
        /** @var string|null */
        public ?string $Carrier=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var string|null */
        public ?string $TrackingNumber=null
    ) {
    }

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

class SessionPaymentIntentDataTransferDataOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $Amount=null,
        /** @var string|null */
        public ?string $Destination=null
    ) {
    }

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

class SessionPaymentIntentDataOptions implements INestedOptions, IHasMetadata, JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $ApplicationFeeAmount=null,
        /** @var string|null */
        public ?string $CaptureMethod=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var array<string,string>|null */
        public ?array $Metadata=null,
        /** @var string|null */
        public ?string $OnBehalfOf=null,
        /** @var string|null */
        public ?string $ReceiptEmail=null,
        /** @var string|null */
        public ?string $SetupFutureUsage=null,
        /** @var ChargeShippingOptions|null */
        public ?ChargeShippingOptions $Shipping=null,
        /** @var string|null */
        public ?string $StatementDescriptor=null,
        /** @var string|null */
        public ?string $StatementDescriptorSuffix=null,
        /** @var SessionPaymentIntentDataTransferDataOptions|null */
        public ?SessionPaymentIntentDataTransferDataOptions $TransferData=null,
        /** @var string|null */
        public ?string $TransferGroup=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ApplicationFeeAmount'])) $this->ApplicationFeeAmount = $o['ApplicationFeeAmount'];
        if (isset($o['CaptureMethod'])) $this->CaptureMethod = $o['CaptureMethod'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Metadata'])) $this->Metadata = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Metadata']);
        if (isset($o['OnBehalfOf'])) $this->OnBehalfOf = $o['OnBehalfOf'];
        if (isset($o['ReceiptEmail'])) $this->ReceiptEmail = $o['ReceiptEmail'];
        if (isset($o['SetupFutureUsage'])) $this->SetupFutureUsage = $o['SetupFutureUsage'];
        if (isset($o['Shipping'])) $this->Shipping = JsonConverters::from('ChargeShippingOptions', $o['Shipping']);
        if (isset($o['StatementDescriptor'])) $this->StatementDescriptor = $o['StatementDescriptor'];
        if (isset($o['StatementDescriptorSuffix'])) $this->StatementDescriptorSuffix = $o['StatementDescriptorSuffix'];
        if (isset($o['TransferData'])) $this->TransferData = JsonConverters::from('SessionPaymentIntentDataTransferDataOptions', $o['TransferData']);
        if (isset($o['TransferGroup'])) $this->TransferGroup = $o['TransferGroup'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ApplicationFeeAmount)) $o['ApplicationFeeAmount'] = $this->ApplicationFeeAmount;
        if (isset($this->CaptureMethod)) $o['CaptureMethod'] = $this->CaptureMethod;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Metadata)) $o['Metadata'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Metadata);
        if (isset($this->OnBehalfOf)) $o['OnBehalfOf'] = $this->OnBehalfOf;
        if (isset($this->ReceiptEmail)) $o['ReceiptEmail'] = $this->ReceiptEmail;
        if (isset($this->SetupFutureUsage)) $o['SetupFutureUsage'] = $this->SetupFutureUsage;
        if (isset($this->Shipping)) $o['Shipping'] = JsonConverters::to('ChargeShippingOptions', $this->Shipping);
        if (isset($this->StatementDescriptor)) $o['StatementDescriptor'] = $this->StatementDescriptor;
        if (isset($this->StatementDescriptorSuffix)) $o['StatementDescriptorSuffix'] = $this->StatementDescriptorSuffix;
        if (isset($this->TransferData)) $o['TransferData'] = JsonConverters::to('SessionPaymentIntentDataTransferDataOptions', $this->TransferData);
        if (isset($this->TransferGroup)) $o['TransferGroup'] = $this->TransferGroup;
        return empty($o) ? new class(){} : $o;
    }
}

class SessionPaymentMethodDataOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $AllowRedisplay=null
    ) {
    }

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

class SessionPaymentMethodOptionsAcssDebitMandateOptionsOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $CustomMandateUrl=null,
        /** @var array<string>|null */
        public ?array $DefaultFor=null,
        /** @var string|null */
        public ?string $IntervalDescription=null,
        /** @var string|null */
        public ?string $PaymentSchedule=null,
        /** @var string|null */
        public ?string $TransactionType=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CustomMandateUrl'])) $this->CustomMandateUrl = $o['CustomMandateUrl'];
        if (isset($o['DefaultFor'])) $this->DefaultFor = JsonConverters::fromArray('string', $o['DefaultFor']);
        if (isset($o['IntervalDescription'])) $this->IntervalDescription = $o['IntervalDescription'];
        if (isset($o['PaymentSchedule'])) $this->PaymentSchedule = $o['PaymentSchedule'];
        if (isset($o['TransactionType'])) $this->TransactionType = $o['TransactionType'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CustomMandateUrl)) $o['CustomMandateUrl'] = $this->CustomMandateUrl;
        if (isset($this->DefaultFor)) $o['DefaultFor'] = JsonConverters::toArray('string', $this->DefaultFor);
        if (isset($this->IntervalDescription)) $o['IntervalDescription'] = $this->IntervalDescription;
        if (isset($this->PaymentSchedule)) $o['PaymentSchedule'] = $this->PaymentSchedule;
        if (isset($this->TransactionType)) $o['TransactionType'] = $this->TransactionType;
        return empty($o) ? new class(){} : $o;
    }
}

class SessionPaymentMethodOptionsAcssDebitOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Currency=null,
        /** @var SessionPaymentMethodOptionsAcssDebitMandateOptionsOptions|null */
        public ?SessionPaymentMethodOptionsAcssDebitMandateOptionsOptions $MandateOptions=null,
        /** @var string|null */
        public ?string $SetupFutureUsage=null,
        /** @var string|null */
        public ?string $VerificationMethod=null
    ) {
    }

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

class SessionPaymentMethodOptionsAffirmOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsAfterpayClearpayOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsAlipayOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsAmazonPayOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsAuBecsDebitOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsBacsDebitOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsBancontactOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsBoletoOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $ExpiresAfterDays=null,
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsCardInstallmentsOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Enabled=null
    ) {
    }

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

class SessionPaymentMethodOptionsCardOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var SessionPaymentMethodOptionsCardInstallmentsOptions|null */
        public ?SessionPaymentMethodOptionsCardInstallmentsOptions $Installments=null,
        /** @var string|null */
        public ?string $RequestThreeDSecure=null,
        /** @var string|null */
        public ?string $SetupFutureUsage=null,
        /** @var string|null */
        public ?string $StatementDescriptorSuffixKana=null,
        /** @var string|null */
        public ?string $StatementDescriptorSuffixKanji=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Installments'])) $this->Installments = JsonConverters::from('SessionPaymentMethodOptionsCardInstallmentsOptions', $o['Installments']);
        if (isset($o['RequestThreeDSecure'])) $this->RequestThreeDSecure = $o['RequestThreeDSecure'];
        if (isset($o['SetupFutureUsage'])) $this->SetupFutureUsage = $o['SetupFutureUsage'];
        if (isset($o['StatementDescriptorSuffixKana'])) $this->StatementDescriptorSuffixKana = $o['StatementDescriptorSuffixKana'];
        if (isset($o['StatementDescriptorSuffixKanji'])) $this->StatementDescriptorSuffixKanji = $o['StatementDescriptorSuffixKanji'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Installments)) $o['Installments'] = JsonConverters::to('SessionPaymentMethodOptionsCardInstallmentsOptions', $this->Installments);
        if (isset($this->RequestThreeDSecure)) $o['RequestThreeDSecure'] = $this->RequestThreeDSecure;
        if (isset($this->SetupFutureUsage)) $o['SetupFutureUsage'] = $this->SetupFutureUsage;
        if (isset($this->StatementDescriptorSuffixKana)) $o['StatementDescriptorSuffixKana'] = $this->StatementDescriptorSuffixKana;
        if (isset($this->StatementDescriptorSuffixKanji)) $o['StatementDescriptorSuffixKanji'] = $this->StatementDescriptorSuffixKanji;
        return empty($o) ? new class(){} : $o;
    }
}

class SessionPaymentMethodOptionsCashappOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Country=null
    ) {
    }

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

class SessionPaymentMethodOptionsCustomerBalanceBankTransferOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var SessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferOptions|null */
        public ?SessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferOptions $EuBankTransfer=null,
        /** @var array<string>|null */
        public ?array $RequestedAddressTypes=null,
        /** @var string|null */
        public ?string $Type=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['EuBankTransfer'])) $this->EuBankTransfer = JsonConverters::from('SessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferOptions', $o['EuBankTransfer']);
        if (isset($o['RequestedAddressTypes'])) $this->RequestedAddressTypes = JsonConverters::fromArray('string', $o['RequestedAddressTypes']);
        if (isset($o['Type'])) $this->Type = $o['Type'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->EuBankTransfer)) $o['EuBankTransfer'] = JsonConverters::to('SessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferOptions', $this->EuBankTransfer);
        if (isset($this->RequestedAddressTypes)) $o['RequestedAddressTypes'] = JsonConverters::toArray('string', $this->RequestedAddressTypes);
        if (isset($this->Type)) $o['Type'] = $this->Type;
        return empty($o) ? new class(){} : $o;
    }
}

class SessionPaymentMethodOptionsCustomerBalanceOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var SessionPaymentMethodOptionsCustomerBalanceBankTransferOptions|null */
        public ?SessionPaymentMethodOptionsCustomerBalanceBankTransferOptions $BankTransfer=null,
        /** @var string|null */
        public ?string $FundingType=null,
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsEpsOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsFpxOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsGiropayOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsGrabpayOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsIdealOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsKlarnaOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsKonbiniOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $ExpiresAfterDays=null,
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsLinkOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsMobilepayOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsMultibancoOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsOxxoOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $ExpiresAfterDays=null,
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsP24Options implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null,
        /** @var bool|null */
        public ?bool $TosShownAndAccepted=null
    ) {
    }

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

class SessionPaymentMethodOptionsPaynowOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsPaypalOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $CaptureMethod=null,
        /** @var string|null */
        public ?string $PreferredLocale=null,
        /** @var string|null */
        public ?string $Reference=null,
        /** @var string|null */
        public ?string $RiskCorrelationId=null,
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsPixOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $ExpiresAfterSeconds=null
    ) {
    }

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

class SessionPaymentMethodOptionsRevolutPayOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsSepaDebitOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsSofortOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsSwishOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Reference=null
    ) {
    }

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

class SessionPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var array<string>|null */
        public ?array $Permissions=null,
        /** @var array<string>|null */
        public ?array $Prefetch=null
    ) {
    }

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

class SessionPaymentMethodOptionsUsBankAccountOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var SessionPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions|null */
        public ?SessionPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions $FinancialConnections=null,
        /** @var string|null */
        public ?string $SetupFutureUsage=null,
        /** @var string|null */
        public ?string $VerificationMethod=null
    ) {
    }

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

class SessionPaymentMethodOptionsWechatPayOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $AppId=null,
        /** @var string|null */
        public ?string $Client=null,
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

class SessionPaymentMethodOptionsOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var SessionPaymentMethodOptionsAcssDebitOptions|null */
        public ?SessionPaymentMethodOptionsAcssDebitOptions $AcssDebit=null,
        /** @var SessionPaymentMethodOptionsAffirmOptions|null */
        public ?SessionPaymentMethodOptionsAffirmOptions $Affirm=null,
        /** @var SessionPaymentMethodOptionsAfterpayClearpayOptions|null */
        public ?SessionPaymentMethodOptionsAfterpayClearpayOptions $AfterpayClearpay=null,
        /** @var SessionPaymentMethodOptionsAlipayOptions|null */
        public ?SessionPaymentMethodOptionsAlipayOptions $Alipay=null,
        /** @var SessionPaymentMethodOptionsAmazonPayOptions|null */
        public ?SessionPaymentMethodOptionsAmazonPayOptions $AmazonPay=null,
        /** @var SessionPaymentMethodOptionsAuBecsDebitOptions|null */
        public ?SessionPaymentMethodOptionsAuBecsDebitOptions $AuBecsDebit=null,
        /** @var SessionPaymentMethodOptionsBacsDebitOptions|null */
        public ?SessionPaymentMethodOptionsBacsDebitOptions $BacsDebit=null,
        /** @var SessionPaymentMethodOptionsBancontactOptions|null */
        public ?SessionPaymentMethodOptionsBancontactOptions $Bancontact=null,
        /** @var SessionPaymentMethodOptionsBoletoOptions|null */
        public ?SessionPaymentMethodOptionsBoletoOptions $Boleto=null,
        /** @var SessionPaymentMethodOptionsCardOptions|null */
        public ?SessionPaymentMethodOptionsCardOptions $Card=null,
        /** @var SessionPaymentMethodOptionsCashappOptions|null */
        public ?SessionPaymentMethodOptionsCashappOptions $Cashapp=null,
        /** @var SessionPaymentMethodOptionsCustomerBalanceOptions|null */
        public ?SessionPaymentMethodOptionsCustomerBalanceOptions $CustomerBalance=null,
        /** @var SessionPaymentMethodOptionsEpsOptions|null */
        public ?SessionPaymentMethodOptionsEpsOptions $Eps=null,
        /** @var SessionPaymentMethodOptionsFpxOptions|null */
        public ?SessionPaymentMethodOptionsFpxOptions $Fpx=null,
        /** @var SessionPaymentMethodOptionsGiropayOptions|null */
        public ?SessionPaymentMethodOptionsGiropayOptions $Giropay=null,
        /** @var SessionPaymentMethodOptionsGrabpayOptions|null */
        public ?SessionPaymentMethodOptionsGrabpayOptions $Grabpay=null,
        /** @var SessionPaymentMethodOptionsIdealOptions|null */
        public ?SessionPaymentMethodOptionsIdealOptions $Ideal=null,
        /** @var SessionPaymentMethodOptionsKlarnaOptions|null */
        public ?SessionPaymentMethodOptionsKlarnaOptions $Klarna=null,
        /** @var SessionPaymentMethodOptionsKonbiniOptions|null */
        public ?SessionPaymentMethodOptionsKonbiniOptions $Konbini=null,
        /** @var SessionPaymentMethodOptionsLinkOptions|null */
        public ?SessionPaymentMethodOptionsLinkOptions $Link=null,
        /** @var SessionPaymentMethodOptionsMobilepayOptions|null */
        public ?SessionPaymentMethodOptionsMobilepayOptions $Mobilepay=null,
        /** @var SessionPaymentMethodOptionsMultibancoOptions|null */
        public ?SessionPaymentMethodOptionsMultibancoOptions $Multibanco=null,
        /** @var SessionPaymentMethodOptionsOxxoOptions|null */
        public ?SessionPaymentMethodOptionsOxxoOptions $Oxxo=null,
        /** @var SessionPaymentMethodOptionsP24Options|null */
        public ?SessionPaymentMethodOptionsP24Options $P24=null,
        /** @var SessionPaymentMethodOptionsPaynowOptions|null */
        public ?SessionPaymentMethodOptionsPaynowOptions $Paynow=null,
        /** @var SessionPaymentMethodOptionsPaypalOptions|null */
        public ?SessionPaymentMethodOptionsPaypalOptions $Paypal=null,
        /** @var SessionPaymentMethodOptionsPixOptions|null */
        public ?SessionPaymentMethodOptionsPixOptions $Pix=null,
        /** @var SessionPaymentMethodOptionsRevolutPayOptions|null */
        public ?SessionPaymentMethodOptionsRevolutPayOptions $RevolutPay=null,
        /** @var SessionPaymentMethodOptionsSepaDebitOptions|null */
        public ?SessionPaymentMethodOptionsSepaDebitOptions $SepaDebit=null,
        /** @var SessionPaymentMethodOptionsSofortOptions|null */
        public ?SessionPaymentMethodOptionsSofortOptions $Sofort=null,
        /** @var SessionPaymentMethodOptionsSwishOptions|null */
        public ?SessionPaymentMethodOptionsSwishOptions $Swish=null,
        /** @var SessionPaymentMethodOptionsUsBankAccountOptions|null */
        public ?SessionPaymentMethodOptionsUsBankAccountOptions $UsBankAccount=null,
        /** @var SessionPaymentMethodOptionsWechatPayOptions|null */
        public ?SessionPaymentMethodOptionsWechatPayOptions $WechatPay=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AcssDebit'])) $this->AcssDebit = JsonConverters::from('SessionPaymentMethodOptionsAcssDebitOptions', $o['AcssDebit']);
        if (isset($o['Affirm'])) $this->Affirm = JsonConverters::from('SessionPaymentMethodOptionsAffirmOptions', $o['Affirm']);
        if (isset($o['AfterpayClearpay'])) $this->AfterpayClearpay = JsonConverters::from('SessionPaymentMethodOptionsAfterpayClearpayOptions', $o['AfterpayClearpay']);
        if (isset($o['Alipay'])) $this->Alipay = JsonConverters::from('SessionPaymentMethodOptionsAlipayOptions', $o['Alipay']);
        if (isset($o['AmazonPay'])) $this->AmazonPay = JsonConverters::from('SessionPaymentMethodOptionsAmazonPayOptions', $o['AmazonPay']);
        if (isset($o['AuBecsDebit'])) $this->AuBecsDebit = JsonConverters::from('SessionPaymentMethodOptionsAuBecsDebitOptions', $o['AuBecsDebit']);
        if (isset($o['BacsDebit'])) $this->BacsDebit = JsonConverters::from('SessionPaymentMethodOptionsBacsDebitOptions', $o['BacsDebit']);
        if (isset($o['Bancontact'])) $this->Bancontact = JsonConverters::from('SessionPaymentMethodOptionsBancontactOptions', $o['Bancontact']);
        if (isset($o['Boleto'])) $this->Boleto = JsonConverters::from('SessionPaymentMethodOptionsBoletoOptions', $o['Boleto']);
        if (isset($o['Card'])) $this->Card = JsonConverters::from('SessionPaymentMethodOptionsCardOptions', $o['Card']);
        if (isset($o['Cashapp'])) $this->Cashapp = JsonConverters::from('SessionPaymentMethodOptionsCashappOptions', $o['Cashapp']);
        if (isset($o['CustomerBalance'])) $this->CustomerBalance = JsonConverters::from('SessionPaymentMethodOptionsCustomerBalanceOptions', $o['CustomerBalance']);
        if (isset($o['Eps'])) $this->Eps = JsonConverters::from('SessionPaymentMethodOptionsEpsOptions', $o['Eps']);
        if (isset($o['Fpx'])) $this->Fpx = JsonConverters::from('SessionPaymentMethodOptionsFpxOptions', $o['Fpx']);
        if (isset($o['Giropay'])) $this->Giropay = JsonConverters::from('SessionPaymentMethodOptionsGiropayOptions', $o['Giropay']);
        if (isset($o['Grabpay'])) $this->Grabpay = JsonConverters::from('SessionPaymentMethodOptionsGrabpayOptions', $o['Grabpay']);
        if (isset($o['Ideal'])) $this->Ideal = JsonConverters::from('SessionPaymentMethodOptionsIdealOptions', $o['Ideal']);
        if (isset($o['Klarna'])) $this->Klarna = JsonConverters::from('SessionPaymentMethodOptionsKlarnaOptions', $o['Klarna']);
        if (isset($o['Konbini'])) $this->Konbini = JsonConverters::from('SessionPaymentMethodOptionsKonbiniOptions', $o['Konbini']);
        if (isset($o['Link'])) $this->Link = JsonConverters::from('SessionPaymentMethodOptionsLinkOptions', $o['Link']);
        if (isset($o['Mobilepay'])) $this->Mobilepay = JsonConverters::from('SessionPaymentMethodOptionsMobilepayOptions', $o['Mobilepay']);
        if (isset($o['Multibanco'])) $this->Multibanco = JsonConverters::from('SessionPaymentMethodOptionsMultibancoOptions', $o['Multibanco']);
        if (isset($o['Oxxo'])) $this->Oxxo = JsonConverters::from('SessionPaymentMethodOptionsOxxoOptions', $o['Oxxo']);
        if (isset($o['P24'])) $this->P24 = JsonConverters::from('SessionPaymentMethodOptionsP24Options', $o['P24']);
        if (isset($o['Paynow'])) $this->Paynow = JsonConverters::from('SessionPaymentMethodOptionsPaynowOptions', $o['Paynow']);
        if (isset($o['Paypal'])) $this->Paypal = JsonConverters::from('SessionPaymentMethodOptionsPaypalOptions', $o['Paypal']);
        if (isset($o['Pix'])) $this->Pix = JsonConverters::from('SessionPaymentMethodOptionsPixOptions', $o['Pix']);
        if (isset($o['RevolutPay'])) $this->RevolutPay = JsonConverters::from('SessionPaymentMethodOptionsRevolutPayOptions', $o['RevolutPay']);
        if (isset($o['SepaDebit'])) $this->SepaDebit = JsonConverters::from('SessionPaymentMethodOptionsSepaDebitOptions', $o['SepaDebit']);
        if (isset($o['Sofort'])) $this->Sofort = JsonConverters::from('SessionPaymentMethodOptionsSofortOptions', $o['Sofort']);
        if (isset($o['Swish'])) $this->Swish = JsonConverters::from('SessionPaymentMethodOptionsSwishOptions', $o['Swish']);
        if (isset($o['UsBankAccount'])) $this->UsBankAccount = JsonConverters::from('SessionPaymentMethodOptionsUsBankAccountOptions', $o['UsBankAccount']);
        if (isset($o['WechatPay'])) $this->WechatPay = JsonConverters::from('SessionPaymentMethodOptionsWechatPayOptions', $o['WechatPay']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->AcssDebit)) $o['AcssDebit'] = JsonConverters::to('SessionPaymentMethodOptionsAcssDebitOptions', $this->AcssDebit);
        if (isset($this->Affirm)) $o['Affirm'] = JsonConverters::to('SessionPaymentMethodOptionsAffirmOptions', $this->Affirm);
        if (isset($this->AfterpayClearpay)) $o['AfterpayClearpay'] = JsonConverters::to('SessionPaymentMethodOptionsAfterpayClearpayOptions', $this->AfterpayClearpay);
        if (isset($this->Alipay)) $o['Alipay'] = JsonConverters::to('SessionPaymentMethodOptionsAlipayOptions', $this->Alipay);
        if (isset($this->AmazonPay)) $o['AmazonPay'] = JsonConverters::to('SessionPaymentMethodOptionsAmazonPayOptions', $this->AmazonPay);
        if (isset($this->AuBecsDebit)) $o['AuBecsDebit'] = JsonConverters::to('SessionPaymentMethodOptionsAuBecsDebitOptions', $this->AuBecsDebit);
        if (isset($this->BacsDebit)) $o['BacsDebit'] = JsonConverters::to('SessionPaymentMethodOptionsBacsDebitOptions', $this->BacsDebit);
        if (isset($this->Bancontact)) $o['Bancontact'] = JsonConverters::to('SessionPaymentMethodOptionsBancontactOptions', $this->Bancontact);
        if (isset($this->Boleto)) $o['Boleto'] = JsonConverters::to('SessionPaymentMethodOptionsBoletoOptions', $this->Boleto);
        if (isset($this->Card)) $o['Card'] = JsonConverters::to('SessionPaymentMethodOptionsCardOptions', $this->Card);
        if (isset($this->Cashapp)) $o['Cashapp'] = JsonConverters::to('SessionPaymentMethodOptionsCashappOptions', $this->Cashapp);
        if (isset($this->CustomerBalance)) $o['CustomerBalance'] = JsonConverters::to('SessionPaymentMethodOptionsCustomerBalanceOptions', $this->CustomerBalance);
        if (isset($this->Eps)) $o['Eps'] = JsonConverters::to('SessionPaymentMethodOptionsEpsOptions', $this->Eps);
        if (isset($this->Fpx)) $o['Fpx'] = JsonConverters::to('SessionPaymentMethodOptionsFpxOptions', $this->Fpx);
        if (isset($this->Giropay)) $o['Giropay'] = JsonConverters::to('SessionPaymentMethodOptionsGiropayOptions', $this->Giropay);
        if (isset($this->Grabpay)) $o['Grabpay'] = JsonConverters::to('SessionPaymentMethodOptionsGrabpayOptions', $this->Grabpay);
        if (isset($this->Ideal)) $o['Ideal'] = JsonConverters::to('SessionPaymentMethodOptionsIdealOptions', $this->Ideal);
        if (isset($this->Klarna)) $o['Klarna'] = JsonConverters::to('SessionPaymentMethodOptionsKlarnaOptions', $this->Klarna);
        if (isset($this->Konbini)) $o['Konbini'] = JsonConverters::to('SessionPaymentMethodOptionsKonbiniOptions', $this->Konbini);
        if (isset($this->Link)) $o['Link'] = JsonConverters::to('SessionPaymentMethodOptionsLinkOptions', $this->Link);
        if (isset($this->Mobilepay)) $o['Mobilepay'] = JsonConverters::to('SessionPaymentMethodOptionsMobilepayOptions', $this->Mobilepay);
        if (isset($this->Multibanco)) $o['Multibanco'] = JsonConverters::to('SessionPaymentMethodOptionsMultibancoOptions', $this->Multibanco);
        if (isset($this->Oxxo)) $o['Oxxo'] = JsonConverters::to('SessionPaymentMethodOptionsOxxoOptions', $this->Oxxo);
        if (isset($this->P24)) $o['P24'] = JsonConverters::to('SessionPaymentMethodOptionsP24Options', $this->P24);
        if (isset($this->Paynow)) $o['Paynow'] = JsonConverters::to('SessionPaymentMethodOptionsPaynowOptions', $this->Paynow);
        if (isset($this->Paypal)) $o['Paypal'] = JsonConverters::to('SessionPaymentMethodOptionsPaypalOptions', $this->Paypal);
        if (isset($this->Pix)) $o['Pix'] = JsonConverters::to('SessionPaymentMethodOptionsPixOptions', $this->Pix);
        if (isset($this->RevolutPay)) $o['RevolutPay'] = JsonConverters::to('SessionPaymentMethodOptionsRevolutPayOptions', $this->RevolutPay);
        if (isset($this->SepaDebit)) $o['SepaDebit'] = JsonConverters::to('SessionPaymentMethodOptionsSepaDebitOptions', $this->SepaDebit);
        if (isset($this->Sofort)) $o['Sofort'] = JsonConverters::to('SessionPaymentMethodOptionsSofortOptions', $this->Sofort);
        if (isset($this->Swish)) $o['Swish'] = JsonConverters::to('SessionPaymentMethodOptionsSwishOptions', $this->Swish);
        if (isset($this->UsBankAccount)) $o['UsBankAccount'] = JsonConverters::to('SessionPaymentMethodOptionsUsBankAccountOptions', $this->UsBankAccount);
        if (isset($this->WechatPay)) $o['WechatPay'] = JsonConverters::to('SessionPaymentMethodOptionsWechatPayOptions', $this->WechatPay);
        return empty($o) ? new class(){} : $o;
    }
}

class SessionPhoneNumberCollectionOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Enabled=null
    ) {
    }

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

class SessionSavedPaymentMethodOptionsOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var array<string>|null */
        public ?array $AllowRedisplayFilters=null,
        /** @var string|null */
        public ?string $PaymentMethodSave=null
    ) {
    }

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

class SessionSetupIntentDataOptions implements INestedOptions, IHasMetadata, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Description=null,
        /** @var array<string,string>|null */
        public ?array $Metadata=null,
        /** @var string|null */
        public ?string $OnBehalfOf=null
    ) {
    }

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

class SessionShippingAddressCollectionOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var array<string>|null */
        public ?array $AllowedCountries=null
    ) {
    }

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

class SessionShippingOptionShippingRateDataDeliveryEstimateMaximumOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Unit=null,
        /** @var int|null */
        public ?int $Value=null
    ) {
    }

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

class SessionShippingOptionShippingRateDataDeliveryEstimateMinimumOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Unit=null,
        /** @var int|null */
        public ?int $Value=null
    ) {
    }

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

class SessionShippingOptionShippingRateDataDeliveryEstimateOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var SessionShippingOptionShippingRateDataDeliveryEstimateMaximumOptions|null */
        public ?SessionShippingOptionShippingRateDataDeliveryEstimateMaximumOptions $Maximum=null,
        /** @var SessionShippingOptionShippingRateDataDeliveryEstimateMinimumOptions|null */
        public ?SessionShippingOptionShippingRateDataDeliveryEstimateMinimumOptions $Minimum=null
    ) {
    }

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

class SessionShippingOptionShippingRateDataFixedAmountCurrencyOptionsOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $Amount=null,
        /** @var string|null */
        public ?string $TaxBehavior=null
    ) {
    }

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

class SessionShippingOptionShippingRateDataFixedAmountOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $Amount=null,
        /** @var string|null */
        public ?string $Currency=null,
        /** @var array<string,SessionShippingOptionShippingRateDataFixedAmountCurrencyOptionsOptions>|null */
        public ?array $CurrencyOptions=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Amount'])) $this->Amount = $o['Amount'];
        if (isset($o['Currency'])) $this->Currency = $o['Currency'];
        if (isset($o['CurrencyOptions'])) $this->CurrencyOptions = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','SessionShippingOptionShippingRateDataFixedAmountCurrencyOptionsOptions']), $o['CurrencyOptions']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Amount)) $o['Amount'] = $this->Amount;
        if (isset($this->Currency)) $o['Currency'] = $this->Currency;
        if (isset($this->CurrencyOptions)) $o['CurrencyOptions'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','SessionShippingOptionShippingRateDataFixedAmountCurrencyOptionsOptions']), $this->CurrencyOptions);
        return empty($o) ? new class(){} : $o;
    }
}

class SessionShippingOptionShippingRateDataOptions implements INestedOptions, IHasMetadata, JsonSerializable
{
    public function __construct(
        /** @var SessionShippingOptionShippingRateDataDeliveryEstimateOptions|null */
        public ?SessionShippingOptionShippingRateDataDeliveryEstimateOptions $DeliveryEstimate=null,
        /** @var string|null */
        public ?string $DisplayName=null,
        /** @var SessionShippingOptionShippingRateDataFixedAmountOptions|null */
        public ?SessionShippingOptionShippingRateDataFixedAmountOptions $FixedAmount=null,
        /** @var array<string,string>|null */
        public ?array $Metadata=null,
        /** @var string|null */
        public ?string $TaxBehavior=null,
        /** @var string|null */
        public ?string $TaxCode=null,
        /** @var string|null */
        public ?string $Type=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['DeliveryEstimate'])) $this->DeliveryEstimate = JsonConverters::from('SessionShippingOptionShippingRateDataDeliveryEstimateOptions', $o['DeliveryEstimate']);
        if (isset($o['DisplayName'])) $this->DisplayName = $o['DisplayName'];
        if (isset($o['FixedAmount'])) $this->FixedAmount = JsonConverters::from('SessionShippingOptionShippingRateDataFixedAmountOptions', $o['FixedAmount']);
        if (isset($o['Metadata'])) $this->Metadata = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Metadata']);
        if (isset($o['TaxBehavior'])) $this->TaxBehavior = $o['TaxBehavior'];
        if (isset($o['TaxCode'])) $this->TaxCode = $o['TaxCode'];
        if (isset($o['Type'])) $this->Type = $o['Type'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->DeliveryEstimate)) $o['DeliveryEstimate'] = JsonConverters::to('SessionShippingOptionShippingRateDataDeliveryEstimateOptions', $this->DeliveryEstimate);
        if (isset($this->DisplayName)) $o['DisplayName'] = $this->DisplayName;
        if (isset($this->FixedAmount)) $o['FixedAmount'] = JsonConverters::to('SessionShippingOptionShippingRateDataFixedAmountOptions', $this->FixedAmount);
        if (isset($this->Metadata)) $o['Metadata'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Metadata);
        if (isset($this->TaxBehavior)) $o['TaxBehavior'] = $this->TaxBehavior;
        if (isset($this->TaxCode)) $o['TaxCode'] = $this->TaxCode;
        if (isset($this->Type)) $o['Type'] = $this->Type;
        return empty($o) ? new class(){} : $o;
    }
}

class SessionShippingOptionOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $ShippingRate=null,
        /** @var SessionShippingOptionShippingRateDataOptions|null */
        public ?SessionShippingOptionShippingRateDataOptions $ShippingRateData=null
    ) {
    }

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

class SessionSubscriptionDataInvoiceSettingsIssuerOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Account=null,
        /** @var string|null */
        public ?string $Type=null
    ) {
    }

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

class SessionSubscriptionDataInvoiceSettingsOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var SessionSubscriptionDataInvoiceSettingsIssuerOptions|null */
        public ?SessionSubscriptionDataInvoiceSettingsIssuerOptions $Issuer=null
    ) {
    }

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

class SessionSubscriptionDataTransferDataOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var float|null */
        public ?float $AmountPercent=null,
        /** @var string|null */
        public ?string $Destination=null
    ) {
    }

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

class SessionSubscriptionDataTrialSettingsEndBehaviorOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $MissingPaymentMethod=null
    ) {
    }

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

class SessionSubscriptionDataTrialSettingsOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var SessionSubscriptionDataTrialSettingsEndBehaviorOptions|null */
        public ?SessionSubscriptionDataTrialSettingsEndBehaviorOptions $EndBehavior=null
    ) {
    }

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

class SessionSubscriptionDataOptions implements INestedOptions, IHasMetadata, JsonSerializable
{
    public function __construct(
        /** @var float|null */
        public ?float $ApplicationFeePercent=null,
        /** @var DateTime|null */
        public ?DateTime $BillingCycleAnchor=null,
        /** @var array<string>|null */
        public ?array $DefaultTaxRates=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var SessionSubscriptionDataInvoiceSettingsOptions|null */
        public ?SessionSubscriptionDataInvoiceSettingsOptions $InvoiceSettings=null,
        /** @var array<string,string>|null */
        public ?array $Metadata=null,
        /** @var string|null */
        public ?string $OnBehalfOf=null,
        /** @var string|null */
        public ?string $ProrationBehavior=null,
        /** @var SessionSubscriptionDataTransferDataOptions|null */
        public ?SessionSubscriptionDataTransferDataOptions $TransferData=null,
        /** @var DateTime|null */
        public ?DateTime $TrialEnd=null,
        /** @var int|null */
        public ?int $TrialPeriodDays=null,
        /** @var SessionSubscriptionDataTrialSettingsOptions|null */
        public ?SessionSubscriptionDataTrialSettingsOptions $TrialSettings=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ApplicationFeePercent'])) $this->ApplicationFeePercent = $o['ApplicationFeePercent'];
        if (isset($o['BillingCycleAnchor'])) $this->BillingCycleAnchor = JsonConverters::from('DateTime', $o['BillingCycleAnchor']);
        if (isset($o['DefaultTaxRates'])) $this->DefaultTaxRates = JsonConverters::fromArray('string', $o['DefaultTaxRates']);
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['InvoiceSettings'])) $this->InvoiceSettings = JsonConverters::from('SessionSubscriptionDataInvoiceSettingsOptions', $o['InvoiceSettings']);
        if (isset($o['Metadata'])) $this->Metadata = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Metadata']);
        if (isset($o['OnBehalfOf'])) $this->OnBehalfOf = $o['OnBehalfOf'];
        if (isset($o['ProrationBehavior'])) $this->ProrationBehavior = $o['ProrationBehavior'];
        if (isset($o['TransferData'])) $this->TransferData = JsonConverters::from('SessionSubscriptionDataTransferDataOptions', $o['TransferData']);
        if (isset($o['TrialEnd'])) $this->TrialEnd = JsonConverters::from('DateTime', $o['TrialEnd']);
        if (isset($o['TrialPeriodDays'])) $this->TrialPeriodDays = $o['TrialPeriodDays'];
        if (isset($o['TrialSettings'])) $this->TrialSettings = JsonConverters::from('SessionSubscriptionDataTrialSettingsOptions', $o['TrialSettings']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ApplicationFeePercent)) $o['ApplicationFeePercent'] = $this->ApplicationFeePercent;
        if (isset($this->BillingCycleAnchor)) $o['BillingCycleAnchor'] = JsonConverters::to('DateTime', $this->BillingCycleAnchor);
        if (isset($this->DefaultTaxRates)) $o['DefaultTaxRates'] = JsonConverters::toArray('string', $this->DefaultTaxRates);
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->InvoiceSettings)) $o['InvoiceSettings'] = JsonConverters::to('SessionSubscriptionDataInvoiceSettingsOptions', $this->InvoiceSettings);
        if (isset($this->Metadata)) $o['Metadata'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Metadata);
        if (isset($this->OnBehalfOf)) $o['OnBehalfOf'] = $this->OnBehalfOf;
        if (isset($this->ProrationBehavior)) $o['ProrationBehavior'] = $this->ProrationBehavior;
        if (isset($this->TransferData)) $o['TransferData'] = JsonConverters::to('SessionSubscriptionDataTransferDataOptions', $this->TransferData);
        if (isset($this->TrialEnd)) $o['TrialEnd'] = JsonConverters::to('DateTime', $this->TrialEnd);
        if (isset($this->TrialPeriodDays)) $o['TrialPeriodDays'] = $this->TrialPeriodDays;
        if (isset($this->TrialSettings)) $o['TrialSettings'] = JsonConverters::to('SessionSubscriptionDataTrialSettingsOptions', $this->TrialSettings);
        return empty($o) ? new class(){} : $o;
    }
}

class SessionTaxIdCollectionOptions implements INestedOptions, JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Enabled=null,
        /** @var string|null */
        public ?string $Required=null
    ) {
    }

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

class SessionCreateOptions extends BaseOptions implements IHasMetadata, JsonSerializable
{
    /**
     * @param array<string>|null $Expand
     * @param array<string,Object>|null $ExtraParams
     */
    public function __construct(
        ?array $Expand=null,
        ?array $ExtraParams=null,
        /** @var SessionAfterExpirationOptions|null */
        public ?SessionAfterExpirationOptions $AfterExpiration=null,
        /** @var bool|null */
        public ?bool $AllowPromotionCodes=null,
        /** @var SessionAutomaticTaxOptions|null */
        public ?SessionAutomaticTaxOptions $AutomaticTax=null,
        /** @var string|null */
        public ?string $BillingAddressCollection=null,
        /** @var string|null */
        public ?string $CancelUrl=null,
        /** @var string|null */
        public ?string $ClientReferenceId=null,
        /** @var SessionConsentCollectionOptions|null */
        public ?SessionConsentCollectionOptions $ConsentCollection=null,
        /** @var string|null */
        public ?string $Currency=null,
        /** @var array<SessionCustomFieldOptions>|null */
        public ?array $CustomFields=null,
        /** @var SessionCustomTextOptions|null */
        public ?SessionCustomTextOptions $CustomText=null,
        /** @var string|null */
        public ?string $Customer=null,
        /** @var string|null */
        public ?string $CustomerCreation=null,
        /** @var string|null */
        public ?string $CustomerEmail=null,
        /** @var SessionCustomerUpdateOptions|null */
        public ?SessionCustomerUpdateOptions $CustomerUpdate=null,
        /** @var array<SessionDiscountOptions>|null */
        public ?array $Discounts=null,
        /** @var DateTime|null */
        public ?DateTime $ExpiresAt=null,
        /** @var SessionInvoiceCreationOptions|null */
        public ?SessionInvoiceCreationOptions $InvoiceCreation=null,
        /** @var array<SessionLineItemOptions>|null */
        public ?array $LineItems=null,
        /** @var string|null */
        public ?string $Locale=null,
        /** @var array<string,string>|null */
        public ?array $Metadata=null,
        /** @var string|null */
        public ?string $Mode=null,
        /** @var SessionPaymentIntentDataOptions|null */
        public ?SessionPaymentIntentDataOptions $PaymentIntentData=null,
        /** @var string|null */
        public ?string $PaymentMethodCollection=null,
        /** @var string|null */
        public ?string $PaymentMethodConfiguration=null,
        /** @var SessionPaymentMethodDataOptions|null */
        public ?SessionPaymentMethodDataOptions $PaymentMethodData=null,
        /** @var SessionPaymentMethodOptionsOptions|null */
        public ?SessionPaymentMethodOptionsOptions $PaymentMethodOptions=null,
        /** @var array<string>|null */
        public ?array $PaymentMethodTypes=null,
        /** @var SessionPhoneNumberCollectionOptions|null */
        public ?SessionPhoneNumberCollectionOptions $PhoneNumberCollection=null,
        /** @var string|null */
        public ?string $RedirectOnCompletion=null,
        /** @var string|null */
        public ?string $ReturnUrl=null,
        /** @var SessionSavedPaymentMethodOptionsOptions|null */
        public ?SessionSavedPaymentMethodOptionsOptions $SavedPaymentMethodOptions=null,
        /** @var SessionSetupIntentDataOptions|null */
        public ?SessionSetupIntentDataOptions $SetupIntentData=null,
        /** @var SessionShippingAddressCollectionOptions|null */
        public ?SessionShippingAddressCollectionOptions $ShippingAddressCollection=null,
        /** @var array<SessionShippingOptionOptions>|null */
        public ?array $ShippingOptions=null,
        /** @var string|null */
        public ?string $SubmitType=null,
        /** @var SessionSubscriptionDataOptions|null */
        public ?SessionSubscriptionDataOptions $SubscriptionData=null,
        /** @var string|null */
        public ?string $SuccessUrl=null,
        /** @var SessionTaxIdCollectionOptions|null */
        public ?SessionTaxIdCollectionOptions $TaxIdCollection=null,
        /** @var string|null */
        public ?string $UiMode=null
    ) {
        parent::__construct($Expand,$ExtraParams);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['AfterExpiration'])) $this->AfterExpiration = JsonConverters::from('SessionAfterExpirationOptions', $o['AfterExpiration']);
        if (isset($o['AllowPromotionCodes'])) $this->AllowPromotionCodes = $o['AllowPromotionCodes'];
        if (isset($o['AutomaticTax'])) $this->AutomaticTax = JsonConverters::from('SessionAutomaticTaxOptions', $o['AutomaticTax']);
        if (isset($o['BillingAddressCollection'])) $this->BillingAddressCollection = $o['BillingAddressCollection'];
        if (isset($o['CancelUrl'])) $this->CancelUrl = $o['CancelUrl'];
        if (isset($o['ClientReferenceId'])) $this->ClientReferenceId = $o['ClientReferenceId'];
        if (isset($o['ConsentCollection'])) $this->ConsentCollection = JsonConverters::from('SessionConsentCollectionOptions', $o['ConsentCollection']);
        if (isset($o['Currency'])) $this->Currency = $o['Currency'];
        if (isset($o['CustomFields'])) $this->CustomFields = JsonConverters::fromArray('SessionCustomFieldOptions', $o['CustomFields']);
        if (isset($o['CustomText'])) $this->CustomText = JsonConverters::from('SessionCustomTextOptions', $o['CustomText']);
        if (isset($o['Customer'])) $this->Customer = $o['Customer'];
        if (isset($o['CustomerCreation'])) $this->CustomerCreation = $o['CustomerCreation'];
        if (isset($o['CustomerEmail'])) $this->CustomerEmail = $o['CustomerEmail'];
        if (isset($o['CustomerUpdate'])) $this->CustomerUpdate = JsonConverters::from('SessionCustomerUpdateOptions', $o['CustomerUpdate']);
        if (isset($o['Discounts'])) $this->Discounts = JsonConverters::fromArray('SessionDiscountOptions', $o['Discounts']);
        if (isset($o['ExpiresAt'])) $this->ExpiresAt = JsonConverters::from('DateTime', $o['ExpiresAt']);
        if (isset($o['InvoiceCreation'])) $this->InvoiceCreation = JsonConverters::from('SessionInvoiceCreationOptions', $o['InvoiceCreation']);
        if (isset($o['LineItems'])) $this->LineItems = JsonConverters::fromArray('SessionLineItemOptions', $o['LineItems']);
        if (isset($o['Locale'])) $this->Locale = $o['Locale'];
        if (isset($o['Metadata'])) $this->Metadata = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Metadata']);
        if (isset($o['Mode'])) $this->Mode = $o['Mode'];
        if (isset($o['PaymentIntentData'])) $this->PaymentIntentData = JsonConverters::from('SessionPaymentIntentDataOptions', $o['PaymentIntentData']);
        if (isset($o['PaymentMethodCollection'])) $this->PaymentMethodCollection = $o['PaymentMethodCollection'];
        if (isset($o['PaymentMethodConfiguration'])) $this->PaymentMethodConfiguration = $o['PaymentMethodConfiguration'];
        if (isset($o['PaymentMethodData'])) $this->PaymentMethodData = JsonConverters::from('SessionPaymentMethodDataOptions', $o['PaymentMethodData']);
        if (isset($o['PaymentMethodOptions'])) $this->PaymentMethodOptions = JsonConverters::from('SessionPaymentMethodOptionsOptions', $o['PaymentMethodOptions']);
        if (isset($o['PaymentMethodTypes'])) $this->PaymentMethodTypes = JsonConverters::fromArray('string', $o['PaymentMethodTypes']);
        if (isset($o['PhoneNumberCollection'])) $this->PhoneNumberCollection = JsonConverters::from('SessionPhoneNumberCollectionOptions', $o['PhoneNumberCollection']);
        if (isset($o['RedirectOnCompletion'])) $this->RedirectOnCompletion = $o['RedirectOnCompletion'];
        if (isset($o['ReturnUrl'])) $this->ReturnUrl = $o['ReturnUrl'];
        if (isset($o['SavedPaymentMethodOptions'])) $this->SavedPaymentMethodOptions = JsonConverters::from('SessionSavedPaymentMethodOptionsOptions', $o['SavedPaymentMethodOptions']);
        if (isset($o['SetupIntentData'])) $this->SetupIntentData = JsonConverters::from('SessionSetupIntentDataOptions', $o['SetupIntentData']);
        if (isset($o['ShippingAddressCollection'])) $this->ShippingAddressCollection = JsonConverters::from('SessionShippingAddressCollectionOptions', $o['ShippingAddressCollection']);
        if (isset($o['ShippingOptions'])) $this->ShippingOptions = JsonConverters::fromArray('SessionShippingOptionOptions', $o['ShippingOptions']);
        if (isset($o['SubmitType'])) $this->SubmitType = $o['SubmitType'];
        if (isset($o['SubscriptionData'])) $this->SubscriptionData = JsonConverters::from('SessionSubscriptionDataOptions', $o['SubscriptionData']);
        if (isset($o['SuccessUrl'])) $this->SuccessUrl = $o['SuccessUrl'];
        if (isset($o['TaxIdCollection'])) $this->TaxIdCollection = JsonConverters::from('SessionTaxIdCollectionOptions', $o['TaxIdCollection']);
        if (isset($o['UiMode'])) $this->UiMode = $o['UiMode'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->AfterExpiration)) $o['AfterExpiration'] = JsonConverters::to('SessionAfterExpirationOptions', $this->AfterExpiration);
        if (isset($this->AllowPromotionCodes)) $o['AllowPromotionCodes'] = $this->AllowPromotionCodes;
        if (isset($this->AutomaticTax)) $o['AutomaticTax'] = JsonConverters::to('SessionAutomaticTaxOptions', $this->AutomaticTax);
        if (isset($this->BillingAddressCollection)) $o['BillingAddressCollection'] = $this->BillingAddressCollection;
        if (isset($this->CancelUrl)) $o['CancelUrl'] = $this->CancelUrl;
        if (isset($this->ClientReferenceId)) $o['ClientReferenceId'] = $this->ClientReferenceId;
        if (isset($this->ConsentCollection)) $o['ConsentCollection'] = JsonConverters::to('SessionConsentCollectionOptions', $this->ConsentCollection);
        if (isset($this->Currency)) $o['Currency'] = $this->Currency;
        if (isset($this->CustomFields)) $o['CustomFields'] = JsonConverters::toArray('SessionCustomFieldOptions', $this->CustomFields);
        if (isset($this->CustomText)) $o['CustomText'] = JsonConverters::to('SessionCustomTextOptions', $this->CustomText);
        if (isset($this->Customer)) $o['Customer'] = $this->Customer;
        if (isset($this->CustomerCreation)) $o['CustomerCreation'] = $this->CustomerCreation;
        if (isset($this->CustomerEmail)) $o['CustomerEmail'] = $this->CustomerEmail;
        if (isset($this->CustomerUpdate)) $o['CustomerUpdate'] = JsonConverters::to('SessionCustomerUpdateOptions', $this->CustomerUpdate);
        if (isset($this->Discounts)) $o['Discounts'] = JsonConverters::toArray('SessionDiscountOptions', $this->Discounts);
        if (isset($this->ExpiresAt)) $o['ExpiresAt'] = JsonConverters::to('DateTime', $this->ExpiresAt);
        if (isset($this->InvoiceCreation)) $o['InvoiceCreation'] = JsonConverters::to('SessionInvoiceCreationOptions', $this->InvoiceCreation);
        if (isset($this->LineItems)) $o['LineItems'] = JsonConverters::toArray('SessionLineItemOptions', $this->LineItems);
        if (isset($this->Locale)) $o['Locale'] = $this->Locale;
        if (isset($this->Metadata)) $o['Metadata'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Metadata);
        if (isset($this->Mode)) $o['Mode'] = $this->Mode;
        if (isset($this->PaymentIntentData)) $o['PaymentIntentData'] = JsonConverters::to('SessionPaymentIntentDataOptions', $this->PaymentIntentData);
        if (isset($this->PaymentMethodCollection)) $o['PaymentMethodCollection'] = $this->PaymentMethodCollection;
        if (isset($this->PaymentMethodConfiguration)) $o['PaymentMethodConfiguration'] = $this->PaymentMethodConfiguration;
        if (isset($this->PaymentMethodData)) $o['PaymentMethodData'] = JsonConverters::to('SessionPaymentMethodDataOptions', $this->PaymentMethodData);
        if (isset($this->PaymentMethodOptions)) $o['PaymentMethodOptions'] = JsonConverters::to('SessionPaymentMethodOptionsOptions', $this->PaymentMethodOptions);
        if (isset($this->PaymentMethodTypes)) $o['PaymentMethodTypes'] = JsonConverters::toArray('string', $this->PaymentMethodTypes);
        if (isset($this->PhoneNumberCollection)) $o['PhoneNumberCollection'] = JsonConverters::to('SessionPhoneNumberCollectionOptions', $this->PhoneNumberCollection);
        if (isset($this->RedirectOnCompletion)) $o['RedirectOnCompletion'] = $this->RedirectOnCompletion;
        if (isset($this->ReturnUrl)) $o['ReturnUrl'] = $this->ReturnUrl;
        if (isset($this->SavedPaymentMethodOptions)) $o['SavedPaymentMethodOptions'] = JsonConverters::to('SessionSavedPaymentMethodOptionsOptions', $this->SavedPaymentMethodOptions);
        if (isset($this->SetupIntentData)) $o['SetupIntentData'] = JsonConverters::to('SessionSetupIntentDataOptions', $this->SetupIntentData);
        if (isset($this->ShippingAddressCollection)) $o['ShippingAddressCollection'] = JsonConverters::to('SessionShippingAddressCollectionOptions', $this->ShippingAddressCollection);
        if (isset($this->ShippingOptions)) $o['ShippingOptions'] = JsonConverters::toArray('SessionShippingOptionOptions', $this->ShippingOptions);
        if (isset($this->SubmitType)) $o['SubmitType'] = $this->SubmitType;
        if (isset($this->SubscriptionData)) $o['SubscriptionData'] = JsonConverters::to('SessionSubscriptionDataOptions', $this->SubscriptionData);
        if (isset($this->SuccessUrl)) $o['SuccessUrl'] = $this->SuccessUrl;
        if (isset($this->TaxIdCollection)) $o['TaxIdCollection'] = JsonConverters::to('SessionTaxIdCollectionOptions', $this->TaxIdCollection);
        if (isset($this->UiMode)) $o['UiMode'] = $this->UiMode;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of SessionAfterExpirationRecovery
 */
class SessionAfterExpirationRecovery extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $AllowPromotionCodes=null,
        /** @var bool|null */
        public ?bool $Enabled=null,
        /** @var DateTime|null */
        public ?DateTime $ExpiresAt=null,
        /** @var string|null */
        public ?string $Url=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionAfterExpiration
 */
class SessionAfterExpiration extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var SessionAfterExpirationRecovery|null */
        public ?SessionAfterExpirationRecovery $Recovery=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionAutomaticTaxLiability
 */
class SessionAutomaticTaxLiability extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Type=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionAutomaticTax
 */
class SessionAutomaticTax extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Enabled=null,
        /** @var SessionAutomaticTaxLiability|null */
        public ?SessionAutomaticTaxLiability $Liability=null,
        /** @var string|null */
        public ?string $Status=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionConsent
 */
class SessionConsent extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Promotions=null,
        /** @var string|null */
        public ?string $TermsOfService=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionConsentCollectionPaymentMethodReuseAgreement
 */
class SessionConsentCollectionPaymentMethodReuseAgreement extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Position=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionConsentCollection
 */
class SessionConsentCollection extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var SessionConsentCollectionPaymentMethodReuseAgreement|null */
        public ?SessionConsentCollectionPaymentMethodReuseAgreement $PaymentMethodReuseAgreement=null,
        /** @var string|null */
        public ?string $Promotions=null,
        /** @var string|null */
        public ?string $TermsOfService=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionCurrencyConversion
 */
class SessionCurrencyConversion extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $AmountSubtotal=0,
        /** @var int */
        public int $AmountTotal=0,
        /** @var float */
        public float $FxRate=0.0,
        /** @var string|null */
        public ?string $SourceCurrency=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionCustomFieldDropdownOption
 */
class SessionCustomFieldDropdownOption extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Label=null,
        /** @var string|null */
        public ?string $Value=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionCustomFieldDropdown
 */
class SessionCustomFieldDropdown extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $DefaultValue=null,
        /** @var array<SessionCustomFieldDropdownOption>|null */
        public ?array $Options=null,
        /** @var string|null */
        public ?string $Value=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionCustomFieldLabel
 */
class SessionCustomFieldLabel extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Custom=null,
        /** @var string|null */
        public ?string $Type=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionCustomFieldNumeric
 */
class SessionCustomFieldNumeric extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $DefaultValue=null,
        /** @var int|null */
        public ?int $MaximumLength=null,
        /** @var int|null */
        public ?int $MinimumLength=null,
        /** @var string|null */
        public ?string $Value=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionCustomFieldText
 */
class SessionCustomFieldText extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $DefaultValue=null,
        /** @var int|null */
        public ?int $MaximumLength=null,
        /** @var int|null */
        public ?int $MinimumLength=null,
        /** @var string|null */
        public ?string $Value=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionCustomField
 */
class SessionCustomField extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var SessionCustomFieldDropdown|null */
        public ?SessionCustomFieldDropdown $Dropdown=null,
        /** @var string|null */
        public ?string $Key=null,
        /** @var SessionCustomFieldLabel|null */
        public ?SessionCustomFieldLabel $Label=null,
        /** @var SessionCustomFieldNumeric|null */
        public ?SessionCustomFieldNumeric $Numeric=null,
        /** @var bool|null */
        public ?bool $Optional=null,
        /** @var SessionCustomFieldText|null */
        public ?SessionCustomFieldText $Text=null,
        /** @var string|null */
        public ?string $Type=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Dropdown'])) $this->Dropdown = JsonConverters::from('SessionCustomFieldDropdown', $o['Dropdown']);
        if (isset($o['Key'])) $this->Key = $o['Key'];
        if (isset($o['Label'])) $this->Label = JsonConverters::from('SessionCustomFieldLabel', $o['Label']);
        if (isset($o['Numeric'])) $this->Numeric = JsonConverters::from('SessionCustomFieldNumeric', $o['Numeric']);
        if (isset($o['Optional'])) $this->Optional = $o['Optional'];
        if (isset($o['Text'])) $this->Text = JsonConverters::from('SessionCustomFieldText', $o['Text']);
        if (isset($o['Type'])) $this->Type = $o['Type'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Dropdown)) $o['Dropdown'] = JsonConverters::to('SessionCustomFieldDropdown', $this->Dropdown);
        if (isset($this->Key)) $o['Key'] = $this->Key;
        if (isset($this->Label)) $o['Label'] = JsonConverters::to('SessionCustomFieldLabel', $this->Label);
        if (isset($this->Numeric)) $o['Numeric'] = JsonConverters::to('SessionCustomFieldNumeric', $this->Numeric);
        if (isset($this->Optional)) $o['Optional'] = $this->Optional;
        if (isset($this->Text)) $o['Text'] = JsonConverters::to('SessionCustomFieldText', $this->Text);
        if (isset($this->Type)) $o['Type'] = $this->Type;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of SessionCustomTextAfterSubmit
 */
class SessionCustomTextAfterSubmit extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Message=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionCustomTextShippingAddress
 */
class SessionCustomTextShippingAddress extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Message=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionCustomTextSubmit
 */
class SessionCustomTextSubmit extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Message=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionCustomTextTermsOfServiceAcceptance
 */
class SessionCustomTextTermsOfServiceAcceptance extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Message=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionCustomText
 */
class SessionCustomText extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var SessionCustomTextAfterSubmit|null */
        public ?SessionCustomTextAfterSubmit $AfterSubmit=null,
        /** @var SessionCustomTextShippingAddress|null */
        public ?SessionCustomTextShippingAddress $ShippingAddress=null,
        /** @var SessionCustomTextSubmit|null */
        public ?SessionCustomTextSubmit $Submit=null,
        /** @var SessionCustomTextTermsOfServiceAcceptance|null */
        public ?SessionCustomTextTermsOfServiceAcceptance $TermsOfServiceAcceptance=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['AfterSubmit'])) $this->AfterSubmit = JsonConverters::from('SessionCustomTextAfterSubmit', $o['AfterSubmit']);
        if (isset($o['ShippingAddress'])) $this->ShippingAddress = JsonConverters::from('SessionCustomTextShippingAddress', $o['ShippingAddress']);
        if (isset($o['Submit'])) $this->Submit = JsonConverters::from('SessionCustomTextSubmit', $o['Submit']);
        if (isset($o['TermsOfServiceAcceptance'])) $this->TermsOfServiceAcceptance = JsonConverters::from('SessionCustomTextTermsOfServiceAcceptance', $o['TermsOfServiceAcceptance']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->AfterSubmit)) $o['AfterSubmit'] = JsonConverters::to('SessionCustomTextAfterSubmit', $this->AfterSubmit);
        if (isset($this->ShippingAddress)) $o['ShippingAddress'] = JsonConverters::to('SessionCustomTextShippingAddress', $this->ShippingAddress);
        if (isset($this->Submit)) $o['Submit'] = JsonConverters::to('SessionCustomTextSubmit', $this->Submit);
        if (isset($this->TermsOfServiceAcceptance)) $o['TermsOfServiceAcceptance'] = JsonConverters::to('SessionCustomTextTermsOfServiceAcceptance', $this->TermsOfServiceAcceptance);
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of Address
 */
class Address extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $City=null,
        /** @var string|null */
        public ?string $Country=null,
        /** @var string|null */
        public ?string $Line1=null,
        /** @var string|null */
        public ?string $Line2=null,
        /** @var string|null */
        public ?string $PostalCode=null,
        /** @var string|null */
        public ?string $State=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionCustomerDetailsTaxId
 */
class SessionCustomerDetailsTaxId extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Type=null,
        /** @var string|null */
        public ?string $Value=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionCustomerDetails
 */
class SessionCustomerDetails extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var Address|null */
        public ?Address $Address=null,
        /** @var string|null */
        public ?string $Email=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var string|null */
        public ?string $TaxExempt=null,
        /** @var array<SessionCustomerDetailsTaxId>|null */
        public ?array $TaxIds=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Address'])) $this->Address = JsonConverters::from('Address', $o['Address']);
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['TaxExempt'])) $this->TaxExempt = $o['TaxExempt'];
        if (isset($o['TaxIds'])) $this->TaxIds = JsonConverters::fromArray('SessionCustomerDetailsTaxId', $o['TaxIds']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Address)) $o['Address'] = JsonConverters::to('Address', $this->Address);
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->TaxExempt)) $o['TaxExempt'] = $this->TaxExempt;
        if (isset($this->TaxIds)) $o['TaxIds'] = JsonConverters::toArray('SessionCustomerDetailsTaxId', $this->TaxIds);
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of SessionInvoiceCreationInvoiceDataCustomField
 */
class SessionInvoiceCreationInvoiceDataCustomField extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Value=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionInvoiceCreationInvoiceDataIssuer
 */
class SessionInvoiceCreationInvoiceDataIssuer extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Type=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionInvoiceCreationInvoiceDataRenderingOptions
 */
class SessionInvoiceCreationInvoiceDataRenderingOptions extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $AmountTaxDisplay=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionInvoiceCreationInvoiceData
 */
class SessionInvoiceCreationInvoiceData extends StripeEntity1 implements IHasMetadata, JsonSerializable
{
    public function __construct(
        /** @var array<SessionInvoiceCreationInvoiceDataCustomField>|null */
        public ?array $CustomFields=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $Footer=null,
        /** @var SessionInvoiceCreationInvoiceDataIssuer|null */
        public ?SessionInvoiceCreationInvoiceDataIssuer $Issuer=null,
        /** @var array<string,string>|null */
        public ?array $Metadata=null,
        /** @var SessionInvoiceCreationInvoiceDataRenderingOptions|null */
        public ?SessionInvoiceCreationInvoiceDataRenderingOptions $RenderingOptions=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['CustomFields'])) $this->CustomFields = JsonConverters::fromArray('SessionInvoiceCreationInvoiceDataCustomField', $o['CustomFields']);
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Footer'])) $this->Footer = $o['Footer'];
        if (isset($o['Issuer'])) $this->Issuer = JsonConverters::from('SessionInvoiceCreationInvoiceDataIssuer', $o['Issuer']);
        if (isset($o['Metadata'])) $this->Metadata = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Metadata']);
        if (isset($o['RenderingOptions'])) $this->RenderingOptions = JsonConverters::from('SessionInvoiceCreationInvoiceDataRenderingOptions', $o['RenderingOptions']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->CustomFields)) $o['CustomFields'] = JsonConverters::toArray('SessionInvoiceCreationInvoiceDataCustomField', $this->CustomFields);
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Footer)) $o['Footer'] = $this->Footer;
        if (isset($this->Issuer)) $o['Issuer'] = JsonConverters::to('SessionInvoiceCreationInvoiceDataIssuer', $this->Issuer);
        if (isset($this->Metadata)) $o['Metadata'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Metadata);
        if (isset($this->RenderingOptions)) $o['RenderingOptions'] = JsonConverters::to('SessionInvoiceCreationInvoiceDataRenderingOptions', $this->RenderingOptions);
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of SessionInvoiceCreation
 */
class SessionInvoiceCreation extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Enabled=null,
        /** @var SessionInvoiceCreationInvoiceData|null */
        public ?SessionInvoiceCreationInvoiceData $InvoiceData=null
    ) {
    }

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

/**
 * @template StripeEntity1 of CouponAppliesTo
 */
class CouponAppliesTo extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var array<string>|null */
        public ?array $Products=null
    ) {
    }

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

/**
 * @template StripeEntity1 of CouponCurrencyOptions
 */
class CouponCurrencyOptions extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $AmountOff=0
    ) {
    }

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

/**
 * @template StripeEntity1 of Coupon
 */
class Coupon extends StripeEntity1 implements IHasId, IHasMetadata, IHasObject, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Id=null,
        /** @var string|null */
        public ?string $Object=null,
        /** @var int|null */
        public ?int $AmountOff=null,
        /** @var CouponAppliesTo|null */
        public ?CouponAppliesTo $AppliesTo=null,
        /** @var DateTime */
        public DateTime $Created=new DateTime(),
        /** @var string|null */
        public ?string $Currency=null,
        /** @var array<string,CouponCurrencyOptions>|null */
        public ?array $CurrencyOptions=null,
        /** @var bool|null */
        public ?bool $Deleted=null,
        /** @var string|null */
        public ?string $Duration=null,
        /** @var int|null */
        public ?int $DurationInMonths=null,
        /** @var bool|null */
        public ?bool $Livemode=null,
        /** @var int|null */
        public ?int $MaxRedemptions=null,
        /** @var array<string,string>|null */
        public ?array $Metadata=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var float|null */
        public ?float $PercentOff=null,
        /** @var DateTime|null */
        public ?DateTime $RedeemBy=null,
        /** @var int */
        public int $TimesRedeemed=0,
        /** @var bool|null */
        public ?bool $Valid=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Object'])) $this->Object = $o['Object'];
        if (isset($o['AmountOff'])) $this->AmountOff = $o['AmountOff'];
        if (isset($o['AppliesTo'])) $this->AppliesTo = JsonConverters::from('CouponAppliesTo', $o['AppliesTo']);
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['Currency'])) $this->Currency = $o['Currency'];
        if (isset($o['CurrencyOptions'])) $this->CurrencyOptions = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','CouponCurrencyOptions']), $o['CurrencyOptions']);
        if (isset($o['Deleted'])) $this->Deleted = $o['Deleted'];
        if (isset($o['Duration'])) $this->Duration = $o['Duration'];
        if (isset($o['DurationInMonths'])) $this->DurationInMonths = $o['DurationInMonths'];
        if (isset($o['Livemode'])) $this->Livemode = $o['Livemode'];
        if (isset($o['MaxRedemptions'])) $this->MaxRedemptions = $o['MaxRedemptions'];
        if (isset($o['Metadata'])) $this->Metadata = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Metadata']);
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['PercentOff'])) $this->PercentOff = $o['PercentOff'];
        if (isset($o['RedeemBy'])) $this->RedeemBy = JsonConverters::from('DateTime', $o['RedeemBy']);
        if (isset($o['TimesRedeemed'])) $this->TimesRedeemed = $o['TimesRedeemed'];
        if (isset($o['Valid'])) $this->Valid = $o['Valid'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Object)) $o['Object'] = $this->Object;
        if (isset($this->AmountOff)) $o['AmountOff'] = $this->AmountOff;
        if (isset($this->AppliesTo)) $o['AppliesTo'] = JsonConverters::to('CouponAppliesTo', $this->AppliesTo);
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->Currency)) $o['Currency'] = $this->Currency;
        if (isset($this->CurrencyOptions)) $o['CurrencyOptions'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','CouponCurrencyOptions']), $this->CurrencyOptions);
        if (isset($this->Deleted)) $o['Deleted'] = $this->Deleted;
        if (isset($this->Duration)) $o['Duration'] = $this->Duration;
        if (isset($this->DurationInMonths)) $o['DurationInMonths'] = $this->DurationInMonths;
        if (isset($this->Livemode)) $o['Livemode'] = $this->Livemode;
        if (isset($this->MaxRedemptions)) $o['MaxRedemptions'] = $this->MaxRedemptions;
        if (isset($this->Metadata)) $o['Metadata'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Metadata);
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->PercentOff)) $o['PercentOff'] = $this->PercentOff;
        if (isset($this->RedeemBy)) $o['RedeemBy'] = JsonConverters::to('DateTime', $this->RedeemBy);
        if (isset($this->TimesRedeemed)) $o['TimesRedeemed'] = $this->TimesRedeemed;
        if (isset($this->Valid)) $o['Valid'] = $this->Valid;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of Discount
 */
class Discount extends StripeEntity1 implements IHasId, IHasObject, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Id=null,
        /** @var string|null */
        public ?string $Object=null,
        /** @var string|null */
        public ?string $CheckoutSession=null,
        /** @var Coupon|null */
        public ?Coupon $Coupon=null,
        /** @var bool|null */
        public ?bool $Deleted=null,
        /** @var DateTime|null */
        public ?DateTime $End=null,
        /** @var string|null */
        public ?string $Invoice=null,
        /** @var string|null */
        public ?string $InvoiceItem=null,
        /** @var DateTime */
        public DateTime $Start=new DateTime(),
        /** @var string|null */
        public ?string $Subscription=null,
        /** @var string|null */
        public ?string $SubscriptionItem=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Object'])) $this->Object = $o['Object'];
        if (isset($o['CheckoutSession'])) $this->CheckoutSession = $o['CheckoutSession'];
        if (isset($o['Coupon'])) $this->Coupon = JsonConverters::from('Coupon', $o['Coupon']);
        if (isset($o['Deleted'])) $this->Deleted = $o['Deleted'];
        if (isset($o['End'])) $this->End = JsonConverters::from('DateTime', $o['End']);
        if (isset($o['Invoice'])) $this->Invoice = $o['Invoice'];
        if (isset($o['InvoiceItem'])) $this->InvoiceItem = $o['InvoiceItem'];
        if (isset($o['Start'])) $this->Start = JsonConverters::from('DateTime', $o['Start']);
        if (isset($o['Subscription'])) $this->Subscription = $o['Subscription'];
        if (isset($o['SubscriptionItem'])) $this->SubscriptionItem = $o['SubscriptionItem'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Object)) $o['Object'] = $this->Object;
        if (isset($this->CheckoutSession)) $o['CheckoutSession'] = $this->CheckoutSession;
        if (isset($this->Coupon)) $o['Coupon'] = JsonConverters::to('Coupon', $this->Coupon);
        if (isset($this->Deleted)) $o['Deleted'] = $this->Deleted;
        if (isset($this->End)) $o['End'] = JsonConverters::to('DateTime', $this->End);
        if (isset($this->Invoice)) $o['Invoice'] = $this->Invoice;
        if (isset($this->InvoiceItem)) $o['InvoiceItem'] = $this->InvoiceItem;
        if (isset($this->Start)) $o['Start'] = JsonConverters::to('DateTime', $this->Start);
        if (isset($this->Subscription)) $o['Subscription'] = $this->Subscription;
        if (isset($this->SubscriptionItem)) $o['SubscriptionItem'] = $this->SubscriptionItem;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of LineItemDiscount
 */
class LineItemDiscount extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Amount=0,
        /** @var Discount|null */
        public ?Discount $Discount=null
    ) {
    }

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

/**
 * @template StripeEntity1 of PriceCurrencyOptionsCustomUnitAmount
 */
class PriceCurrencyOptionsCustomUnitAmount extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $Maximum=null,
        /** @var int|null */
        public ?int $Minimum=null,
        /** @var int|null */
        public ?int $Preset=null
    ) {
    }

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

/**
 * @template StripeEntity1 of PriceCurrencyOptionsTier
 */
class PriceCurrencyOptionsTier extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $FlatAmount=null,
        /** @var float|null */
        public ?float $FlatAmountDecimal=null,
        /** @var int|null */
        public ?int $UnitAmount=null,
        /** @var float|null */
        public ?float $UnitAmountDecimal=null,
        /** @var int|null */
        public ?int $UpTo=null
    ) {
    }

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

/**
 * @template StripeEntity1 of PriceCurrencyOptions
 */
class PriceCurrencyOptions extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var PriceCurrencyOptionsCustomUnitAmount|null */
        public ?PriceCurrencyOptionsCustomUnitAmount $CustomUnitAmount=null,
        /** @var string|null */
        public ?string $TaxBehavior=null,
        /** @var array<PriceCurrencyOptionsTier>|null */
        public ?array $Tiers=null,
        /** @var int|null */
        public ?int $UnitAmount=null,
        /** @var float|null */
        public ?float $UnitAmountDecimal=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['CustomUnitAmount'])) $this->CustomUnitAmount = JsonConverters::from('PriceCurrencyOptionsCustomUnitAmount', $o['CustomUnitAmount']);
        if (isset($o['TaxBehavior'])) $this->TaxBehavior = $o['TaxBehavior'];
        if (isset($o['Tiers'])) $this->Tiers = JsonConverters::fromArray('PriceCurrencyOptionsTier', $o['Tiers']);
        if (isset($o['UnitAmount'])) $this->UnitAmount = $o['UnitAmount'];
        if (isset($o['UnitAmountDecimal'])) $this->UnitAmountDecimal = $o['UnitAmountDecimal'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->CustomUnitAmount)) $o['CustomUnitAmount'] = JsonConverters::to('PriceCurrencyOptionsCustomUnitAmount', $this->CustomUnitAmount);
        if (isset($this->TaxBehavior)) $o['TaxBehavior'] = $this->TaxBehavior;
        if (isset($this->Tiers)) $o['Tiers'] = JsonConverters::toArray('PriceCurrencyOptionsTier', $this->Tiers);
        if (isset($this->UnitAmount)) $o['UnitAmount'] = $this->UnitAmount;
        if (isset($this->UnitAmountDecimal)) $o['UnitAmountDecimal'] = $this->UnitAmountDecimal;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of PriceCustomUnitAmount
 */
class PriceCustomUnitAmount extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $Maximum=null,
        /** @var int|null */
        public ?int $Minimum=null,
        /** @var int|null */
        public ?int $Preset=null
    ) {
    }

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

/**
 * @template StripeEntity1 of PriceRecurring
 */
class PriceRecurring extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $AggregateUsage=null,
        /** @var string|null */
        public ?string $Interval=null,
        /** @var int */
        public int $IntervalCount=0,
        /** @var string|null */
        public ?string $Meter=null,
        /** @var int|null */
        public ?int $TrialPeriodDays=null,
        /** @var string|null */
        public ?string $UsageType=null
    ) {
    }

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

/**
 * @template StripeEntity1 of PriceTier
 */
class PriceTier extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $FlatAmount=null,
        /** @var float|null */
        public ?float $FlatAmountDecimal=null,
        /** @var int|null */
        public ?int $UnitAmount=null,
        /** @var float|null */
        public ?float $UnitAmountDecimal=null,
        /** @var int|null */
        public ?int $UpTo=null
    ) {
    }

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

/**
 * @template StripeEntity1 of PriceTransformQuantity
 */
class PriceTransformQuantity extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $DivideBy=0,
        /** @var string|null */
        public ?string $Round=null
    ) {
    }

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

/**
 * @template StripeEntity1 of Price
 */
class Price extends StripeEntity1 implements IHasId, IHasMetadata, IHasObject, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Id=null,
        /** @var string|null */
        public ?string $Object=null,
        /** @var bool|null */
        public ?bool $Active=null,
        /** @var string|null */
        public ?string $BillingScheme=null,
        /** @var DateTime */
        public DateTime $Created=new DateTime(),
        /** @var string|null */
        public ?string $Currency=null,
        /** @var array<string,PriceCurrencyOptions>|null */
        public ?array $CurrencyOptions=null,
        /** @var PriceCustomUnitAmount|null */
        public ?PriceCustomUnitAmount $CustomUnitAmount=null,
        /** @var bool|null */
        public ?bool $Deleted=null,
        /** @var bool|null */
        public ?bool $Livemode=null,
        /** @var string|null */
        public ?string $LookupKey=null,
        /** @var array<string,string>|null */
        public ?array $Metadata=null,
        /** @var string|null */
        public ?string $Nickname=null,
        /** @var PriceRecurring|null */
        public ?PriceRecurring $Recurring=null,
        /** @var string|null */
        public ?string $TaxBehavior=null,
        /** @var array<PriceTier>|null */
        public ?array $Tiers=null,
        /** @var string|null */
        public ?string $TiersMode=null,
        /** @var PriceTransformQuantity|null */
        public ?PriceTransformQuantity $TransformQuantity=null,
        /** @var string|null */
        public ?string $Type=null,
        /** @var int|null */
        public ?int $UnitAmount=null,
        /** @var float|null */
        public ?float $UnitAmountDecimal=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Object'])) $this->Object = $o['Object'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['BillingScheme'])) $this->BillingScheme = $o['BillingScheme'];
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['Currency'])) $this->Currency = $o['Currency'];
        if (isset($o['CurrencyOptions'])) $this->CurrencyOptions = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','PriceCurrencyOptions']), $o['CurrencyOptions']);
        if (isset($o['CustomUnitAmount'])) $this->CustomUnitAmount = JsonConverters::from('PriceCustomUnitAmount', $o['CustomUnitAmount']);
        if (isset($o['Deleted'])) $this->Deleted = $o['Deleted'];
        if (isset($o['Livemode'])) $this->Livemode = $o['Livemode'];
        if (isset($o['LookupKey'])) $this->LookupKey = $o['LookupKey'];
        if (isset($o['Metadata'])) $this->Metadata = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Metadata']);
        if (isset($o['Nickname'])) $this->Nickname = $o['Nickname'];
        if (isset($o['Recurring'])) $this->Recurring = JsonConverters::from('PriceRecurring', $o['Recurring']);
        if (isset($o['TaxBehavior'])) $this->TaxBehavior = $o['TaxBehavior'];
        if (isset($o['Tiers'])) $this->Tiers = JsonConverters::fromArray('PriceTier', $o['Tiers']);
        if (isset($o['TiersMode'])) $this->TiersMode = $o['TiersMode'];
        if (isset($o['TransformQuantity'])) $this->TransformQuantity = JsonConverters::from('PriceTransformQuantity', $o['TransformQuantity']);
        if (isset($o['Type'])) $this->Type = $o['Type'];
        if (isset($o['UnitAmount'])) $this->UnitAmount = $o['UnitAmount'];
        if (isset($o['UnitAmountDecimal'])) $this->UnitAmountDecimal = $o['UnitAmountDecimal'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Object)) $o['Object'] = $this->Object;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->BillingScheme)) $o['BillingScheme'] = $this->BillingScheme;
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->Currency)) $o['Currency'] = $this->Currency;
        if (isset($this->CurrencyOptions)) $o['CurrencyOptions'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','PriceCurrencyOptions']), $this->CurrencyOptions);
        if (isset($this->CustomUnitAmount)) $o['CustomUnitAmount'] = JsonConverters::to('PriceCustomUnitAmount', $this->CustomUnitAmount);
        if (isset($this->Deleted)) $o['Deleted'] = $this->Deleted;
        if (isset($this->Livemode)) $o['Livemode'] = $this->Livemode;
        if (isset($this->LookupKey)) $o['LookupKey'] = $this->LookupKey;
        if (isset($this->Metadata)) $o['Metadata'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Metadata);
        if (isset($this->Nickname)) $o['Nickname'] = $this->Nickname;
        if (isset($this->Recurring)) $o['Recurring'] = JsonConverters::to('PriceRecurring', $this->Recurring);
        if (isset($this->TaxBehavior)) $o['TaxBehavior'] = $this->TaxBehavior;
        if (isset($this->Tiers)) $o['Tiers'] = JsonConverters::toArray('PriceTier', $this->Tiers);
        if (isset($this->TiersMode)) $o['TiersMode'] = $this->TiersMode;
        if (isset($this->TransformQuantity)) $o['TransformQuantity'] = JsonConverters::to('PriceTransformQuantity', $this->TransformQuantity);
        if (isset($this->Type)) $o['Type'] = $this->Type;
        if (isset($this->UnitAmount)) $o['UnitAmount'] = $this->UnitAmount;
        if (isset($this->UnitAmountDecimal)) $o['UnitAmountDecimal'] = $this->UnitAmountDecimal;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of TaxRate
 */
class TaxRate extends StripeEntity1 implements IHasId, IHasMetadata, IHasObject, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Id=null,
        /** @var string|null */
        public ?string $Object=null,
        /** @var bool|null */
        public ?bool $Active=null,
        /** @var string|null */
        public ?string $Country=null,
        /** @var DateTime */
        public DateTime $Created=new DateTime(),
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $DisplayName=null,
        /** @var float|null */
        public ?float $EffectivePercentage=null,
        /** @var bool|null */
        public ?bool $Inclusive=null,
        /** @var string|null */
        public ?string $Jurisdiction=null,
        /** @var string|null */
        public ?string $JurisdictionLevel=null,
        /** @var bool|null */
        public ?bool $Livemode=null,
        /** @var array<string,string>|null */
        public ?array $Metadata=null,
        /** @var float */
        public float $Percentage=0.0,
        /** @var string|null */
        public ?string $State=null,
        /** @var string|null */
        public ?string $TaxType=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Object'])) $this->Object = $o['Object'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['Country'])) $this->Country = $o['Country'];
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['DisplayName'])) $this->DisplayName = $o['DisplayName'];
        if (isset($o['EffectivePercentage'])) $this->EffectivePercentage = $o['EffectivePercentage'];
        if (isset($o['Inclusive'])) $this->Inclusive = $o['Inclusive'];
        if (isset($o['Jurisdiction'])) $this->Jurisdiction = $o['Jurisdiction'];
        if (isset($o['JurisdictionLevel'])) $this->JurisdictionLevel = $o['JurisdictionLevel'];
        if (isset($o['Livemode'])) $this->Livemode = $o['Livemode'];
        if (isset($o['Metadata'])) $this->Metadata = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Metadata']);
        if (isset($o['Percentage'])) $this->Percentage = $o['Percentage'];
        if (isset($o['State'])) $this->State = $o['State'];
        if (isset($o['TaxType'])) $this->TaxType = $o['TaxType'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Object)) $o['Object'] = $this->Object;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->Country)) $o['Country'] = $this->Country;
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->DisplayName)) $o['DisplayName'] = $this->DisplayName;
        if (isset($this->EffectivePercentage)) $o['EffectivePercentage'] = $this->EffectivePercentage;
        if (isset($this->Inclusive)) $o['Inclusive'] = $this->Inclusive;
        if (isset($this->Jurisdiction)) $o['Jurisdiction'] = $this->Jurisdiction;
        if (isset($this->JurisdictionLevel)) $o['JurisdictionLevel'] = $this->JurisdictionLevel;
        if (isset($this->Livemode)) $o['Livemode'] = $this->Livemode;
        if (isset($this->Metadata)) $o['Metadata'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Metadata);
        if (isset($this->Percentage)) $o['Percentage'] = $this->Percentage;
        if (isset($this->State)) $o['State'] = $this->State;
        if (isset($this->TaxType)) $o['TaxType'] = $this->TaxType;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of LineItemTax
 */
class LineItemTax extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Amount=0,
        /** @var TaxRate|null */
        public ?TaxRate $Rate=null,
        /** @var string|null */
        public ?string $TaxabilityReason=null,
        /** @var int|null */
        public ?int $TaxableAmount=null
    ) {
    }

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

/**
 * @template StripeEntity1 of LineItem
 */
class LineItem extends StripeEntity1 implements IHasId, IHasObject, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Id=null,
        /** @var string|null */
        public ?string $Object=null,
        /** @var int */
        public int $AmountDiscount=0,
        /** @var int */
        public int $AmountSubtotal=0,
        /** @var int */
        public int $AmountTax=0,
        /** @var int */
        public int $AmountTotal=0,
        /** @var string|null */
        public ?string $Currency=null,
        /** @var bool|null */
        public ?bool $Deleted=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var array<LineItemDiscount>|null */
        public ?array $Discounts=null,
        /** @var Price|null */
        public ?Price $Price=null,
        /** @var int|null */
        public ?int $Quantity=null,
        /** @var array<LineItemTax>|null */
        public ?array $Taxes=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Object'])) $this->Object = $o['Object'];
        if (isset($o['AmountDiscount'])) $this->AmountDiscount = $o['AmountDiscount'];
        if (isset($o['AmountSubtotal'])) $this->AmountSubtotal = $o['AmountSubtotal'];
        if (isset($o['AmountTax'])) $this->AmountTax = $o['AmountTax'];
        if (isset($o['AmountTotal'])) $this->AmountTotal = $o['AmountTotal'];
        if (isset($o['Currency'])) $this->Currency = $o['Currency'];
        if (isset($o['Deleted'])) $this->Deleted = $o['Deleted'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Discounts'])) $this->Discounts = JsonConverters::fromArray('LineItemDiscount', $o['Discounts']);
        if (isset($o['Price'])) $this->Price = JsonConverters::from('Price', $o['Price']);
        if (isset($o['Quantity'])) $this->Quantity = $o['Quantity'];
        if (isset($o['Taxes'])) $this->Taxes = JsonConverters::fromArray('LineItemTax', $o['Taxes']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Object)) $o['Object'] = $this->Object;
        if (isset($this->AmountDiscount)) $o['AmountDiscount'] = $this->AmountDiscount;
        if (isset($this->AmountSubtotal)) $o['AmountSubtotal'] = $this->AmountSubtotal;
        if (isset($this->AmountTax)) $o['AmountTax'] = $this->AmountTax;
        if (isset($this->AmountTotal)) $o['AmountTotal'] = $this->AmountTotal;
        if (isset($this->Currency)) $o['Currency'] = $this->Currency;
        if (isset($this->Deleted)) $o['Deleted'] = $this->Deleted;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Discounts)) $o['Discounts'] = JsonConverters::toArray('LineItemDiscount', $this->Discounts);
        if (isset($this->Price)) $o['Price'] = JsonConverters::to('Price', $this->Price);
        if (isset($this->Quantity)) $o['Quantity'] = $this->Quantity;
        if (isset($this->Taxes)) $o['Taxes'] = JsonConverters::toArray('LineItemTax', $this->Taxes);
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of SessionPaymentMethodConfigurationDetails
 */
class SessionPaymentMethodConfigurationDetails extends StripeEntity1 implements IHasId, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Id=null,
        /** @var string|null */
        public ?string $Parent=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsAcssDebitMandateOptions
 */
class SessionPaymentMethodOptionsAcssDebitMandateOptions extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $CustomMandateUrl=null,
        /** @var array<string>|null */
        public ?array $DefaultFor=null,
        /** @var string|null */
        public ?string $IntervalDescription=null,
        /** @var string|null */
        public ?string $PaymentSchedule=null,
        /** @var string|null */
        public ?string $TransactionType=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['CustomMandateUrl'])) $this->CustomMandateUrl = $o['CustomMandateUrl'];
        if (isset($o['DefaultFor'])) $this->DefaultFor = JsonConverters::fromArray('string', $o['DefaultFor']);
        if (isset($o['IntervalDescription'])) $this->IntervalDescription = $o['IntervalDescription'];
        if (isset($o['PaymentSchedule'])) $this->PaymentSchedule = $o['PaymentSchedule'];
        if (isset($o['TransactionType'])) $this->TransactionType = $o['TransactionType'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->CustomMandateUrl)) $o['CustomMandateUrl'] = $this->CustomMandateUrl;
        if (isset($this->DefaultFor)) $o['DefaultFor'] = JsonConverters::toArray('string', $this->DefaultFor);
        if (isset($this->IntervalDescription)) $o['IntervalDescription'] = $this->IntervalDescription;
        if (isset($this->PaymentSchedule)) $o['PaymentSchedule'] = $this->PaymentSchedule;
        if (isset($this->TransactionType)) $o['TransactionType'] = $this->TransactionType;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsAcssDebit
 */
class SessionPaymentMethodOptionsAcssDebit extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Currency=null,
        /** @var SessionPaymentMethodOptionsAcssDebitMandateOptions|null */
        public ?SessionPaymentMethodOptionsAcssDebitMandateOptions $MandateOptions=null,
        /** @var string|null */
        public ?string $SetupFutureUsage=null,
        /** @var string|null */
        public ?string $VerificationMethod=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsAffirm
 */
class SessionPaymentMethodOptionsAffirm extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsAfterpayClearpay
 */
class SessionPaymentMethodOptionsAfterpayClearpay extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsAlipay
 */
class SessionPaymentMethodOptionsAlipay extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsAmazonPay
 */
class SessionPaymentMethodOptionsAmazonPay extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsAuBecsDebit
 */
class SessionPaymentMethodOptionsAuBecsDebit extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsBacsDebit
 */
class SessionPaymentMethodOptionsBacsDebit extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsBancontact
 */
class SessionPaymentMethodOptionsBancontact extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsBoleto
 */
class SessionPaymentMethodOptionsBoleto extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ExpiresAfterDays=0,
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsCardInstallments
 */
class SessionPaymentMethodOptionsCardInstallments extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Enabled=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsCard
 */
class SessionPaymentMethodOptionsCard extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var SessionPaymentMethodOptionsCardInstallments|null */
        public ?SessionPaymentMethodOptionsCardInstallments $Installments=null,
        /** @var string|null */
        public ?string $RequestThreeDSecure=null,
        /** @var string|null */
        public ?string $SetupFutureUsage=null,
        /** @var string|null */
        public ?string $StatementDescriptorSuffixKana=null,
        /** @var string|null */
        public ?string $StatementDescriptorSuffixKanji=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Installments'])) $this->Installments = JsonConverters::from('SessionPaymentMethodOptionsCardInstallments', $o['Installments']);
        if (isset($o['RequestThreeDSecure'])) $this->RequestThreeDSecure = $o['RequestThreeDSecure'];
        if (isset($o['SetupFutureUsage'])) $this->SetupFutureUsage = $o['SetupFutureUsage'];
        if (isset($o['StatementDescriptorSuffixKana'])) $this->StatementDescriptorSuffixKana = $o['StatementDescriptorSuffixKana'];
        if (isset($o['StatementDescriptorSuffixKanji'])) $this->StatementDescriptorSuffixKanji = $o['StatementDescriptorSuffixKanji'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Installments)) $o['Installments'] = JsonConverters::to('SessionPaymentMethodOptionsCardInstallments', $this->Installments);
        if (isset($this->RequestThreeDSecure)) $o['RequestThreeDSecure'] = $this->RequestThreeDSecure;
        if (isset($this->SetupFutureUsage)) $o['SetupFutureUsage'] = $this->SetupFutureUsage;
        if (isset($this->StatementDescriptorSuffixKana)) $o['StatementDescriptorSuffixKana'] = $this->StatementDescriptorSuffixKana;
        if (isset($this->StatementDescriptorSuffixKanji)) $o['StatementDescriptorSuffixKanji'] = $this->StatementDescriptorSuffixKanji;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsCashapp
 */
class SessionPaymentMethodOptionsCashapp extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer
 */
class SessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Country=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsCustomerBalanceBankTransfer
 */
class SessionPaymentMethodOptionsCustomerBalanceBankTransfer extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var SessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer|null */
        public ?SessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer $EuBankTransfer=null,
        /** @var array<string>|null */
        public ?array $RequestedAddressTypes=null,
        /** @var string|null */
        public ?string $Type=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsCustomerBalance
 */
class SessionPaymentMethodOptionsCustomerBalance extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var SessionPaymentMethodOptionsCustomerBalanceBankTransfer|null */
        public ?SessionPaymentMethodOptionsCustomerBalanceBankTransfer $BankTransfer=null,
        /** @var string|null */
        public ?string $FundingType=null,
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsEps
 */
class SessionPaymentMethodOptionsEps extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsFpx
 */
class SessionPaymentMethodOptionsFpx extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsGiropay
 */
class SessionPaymentMethodOptionsGiropay extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsGrabpay
 */
class SessionPaymentMethodOptionsGrabpay extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsIdeal
 */
class SessionPaymentMethodOptionsIdeal extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsKlarna
 */
class SessionPaymentMethodOptionsKlarna extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsKonbini
 */
class SessionPaymentMethodOptionsKonbini extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $ExpiresAfterDays=null,
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsLink
 */
class SessionPaymentMethodOptionsLink extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsMobilepay
 */
class SessionPaymentMethodOptionsMobilepay extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsMultibanco
 */
class SessionPaymentMethodOptionsMultibanco extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsOxxo
 */
class SessionPaymentMethodOptionsOxxo extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ExpiresAfterDays=0,
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsP24
 */
class SessionPaymentMethodOptionsP24 extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsPaynow
 */
class SessionPaymentMethodOptionsPaynow extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsPaypal
 */
class SessionPaymentMethodOptionsPaypal extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $CaptureMethod=null,
        /** @var string|null */
        public ?string $PreferredLocale=null,
        /** @var string|null */
        public ?string $Reference=null,
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsPix
 */
class SessionPaymentMethodOptionsPix extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $ExpiresAfterSeconds=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsRevolutPay
 */
class SessionPaymentMethodOptionsRevolutPay extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsSepaDebit
 */
class SessionPaymentMethodOptionsSepaDebit extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsSofort
 */
class SessionPaymentMethodOptionsSofort extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SetupFutureUsage=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsSwish
 */
class SessionPaymentMethodOptionsSwish extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Reference=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters
 */
class SessionPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var array<string>|null */
        public ?array $AccountSubcategories=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsUsBankAccountFinancialConnections
 */
class SessionPaymentMethodOptionsUsBankAccountFinancialConnections extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var SessionPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters|null */
        public ?SessionPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters $Filters=null,
        /** @var array<string>|null */
        public ?array $Permissions=null,
        /** @var array<string>|null */
        public ?array $Prefetch=null,
        /** @var string|null */
        public ?string $ReturnUrl=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Filters'])) $this->Filters = JsonConverters::from('SessionPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters', $o['Filters']);
        if (isset($o['Permissions'])) $this->Permissions = JsonConverters::fromArray('string', $o['Permissions']);
        if (isset($o['Prefetch'])) $this->Prefetch = JsonConverters::fromArray('string', $o['Prefetch']);
        if (isset($o['ReturnUrl'])) $this->ReturnUrl = $o['ReturnUrl'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Filters)) $o['Filters'] = JsonConverters::to('SessionPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters', $this->Filters);
        if (isset($this->Permissions)) $o['Permissions'] = JsonConverters::toArray('string', $this->Permissions);
        if (isset($this->Prefetch)) $o['Prefetch'] = JsonConverters::toArray('string', $this->Prefetch);
        if (isset($this->ReturnUrl)) $o['ReturnUrl'] = $this->ReturnUrl;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of SessionPaymentMethodOptionsUsBankAccount
 */
class SessionPaymentMethodOptionsUsBankAccount extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var SessionPaymentMethodOptionsUsBankAccountFinancialConnections|null */
        public ?SessionPaymentMethodOptionsUsBankAccountFinancialConnections $FinancialConnections=null,
        /** @var string|null */
        public ?string $SetupFutureUsage=null,
        /** @var string|null */
        public ?string $VerificationMethod=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionPaymentMethodOptions
 */
class SessionPaymentMethodOptions extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var SessionPaymentMethodOptionsAcssDebit|null */
        public ?SessionPaymentMethodOptionsAcssDebit $AcssDebit=null,
        /** @var SessionPaymentMethodOptionsAffirm|null */
        public ?SessionPaymentMethodOptionsAffirm $Affirm=null,
        /** @var SessionPaymentMethodOptionsAfterpayClearpay|null */
        public ?SessionPaymentMethodOptionsAfterpayClearpay $AfterpayClearpay=null,
        /** @var SessionPaymentMethodOptionsAlipay|null */
        public ?SessionPaymentMethodOptionsAlipay $Alipay=null,
        /** @var SessionPaymentMethodOptionsAmazonPay|null */
        public ?SessionPaymentMethodOptionsAmazonPay $AmazonPay=null,
        /** @var SessionPaymentMethodOptionsAuBecsDebit|null */
        public ?SessionPaymentMethodOptionsAuBecsDebit $AuBecsDebit=null,
        /** @var SessionPaymentMethodOptionsBacsDebit|null */
        public ?SessionPaymentMethodOptionsBacsDebit $BacsDebit=null,
        /** @var SessionPaymentMethodOptionsBancontact|null */
        public ?SessionPaymentMethodOptionsBancontact $Bancontact=null,
        /** @var SessionPaymentMethodOptionsBoleto|null */
        public ?SessionPaymentMethodOptionsBoleto $Boleto=null,
        /** @var SessionPaymentMethodOptionsCard|null */
        public ?SessionPaymentMethodOptionsCard $Card=null,
        /** @var SessionPaymentMethodOptionsCashapp|null */
        public ?SessionPaymentMethodOptionsCashapp $Cashapp=null,
        /** @var SessionPaymentMethodOptionsCustomerBalance|null */
        public ?SessionPaymentMethodOptionsCustomerBalance $CustomerBalance=null,
        /** @var SessionPaymentMethodOptionsEps|null */
        public ?SessionPaymentMethodOptionsEps $Eps=null,
        /** @var SessionPaymentMethodOptionsFpx|null */
        public ?SessionPaymentMethodOptionsFpx $Fpx=null,
        /** @var SessionPaymentMethodOptionsGiropay|null */
        public ?SessionPaymentMethodOptionsGiropay $Giropay=null,
        /** @var SessionPaymentMethodOptionsGrabpay|null */
        public ?SessionPaymentMethodOptionsGrabpay $Grabpay=null,
        /** @var SessionPaymentMethodOptionsIdeal|null */
        public ?SessionPaymentMethodOptionsIdeal $Ideal=null,
        /** @var SessionPaymentMethodOptionsKlarna|null */
        public ?SessionPaymentMethodOptionsKlarna $Klarna=null,
        /** @var SessionPaymentMethodOptionsKonbini|null */
        public ?SessionPaymentMethodOptionsKonbini $Konbini=null,
        /** @var SessionPaymentMethodOptionsLink|null */
        public ?SessionPaymentMethodOptionsLink $Link=null,
        /** @var SessionPaymentMethodOptionsMobilepay|null */
        public ?SessionPaymentMethodOptionsMobilepay $Mobilepay=null,
        /** @var SessionPaymentMethodOptionsMultibanco|null */
        public ?SessionPaymentMethodOptionsMultibanco $Multibanco=null,
        /** @var SessionPaymentMethodOptionsOxxo|null */
        public ?SessionPaymentMethodOptionsOxxo $Oxxo=null,
        /** @var SessionPaymentMethodOptionsP24|null */
        public ?SessionPaymentMethodOptionsP24 $P24=null,
        /** @var SessionPaymentMethodOptionsPaynow|null */
        public ?SessionPaymentMethodOptionsPaynow $Paynow=null,
        /** @var SessionPaymentMethodOptionsPaypal|null */
        public ?SessionPaymentMethodOptionsPaypal $Paypal=null,
        /** @var SessionPaymentMethodOptionsPix|null */
        public ?SessionPaymentMethodOptionsPix $Pix=null,
        /** @var SessionPaymentMethodOptionsRevolutPay|null */
        public ?SessionPaymentMethodOptionsRevolutPay $RevolutPay=null,
        /** @var SessionPaymentMethodOptionsSepaDebit|null */
        public ?SessionPaymentMethodOptionsSepaDebit $SepaDebit=null,
        /** @var SessionPaymentMethodOptionsSofort|null */
        public ?SessionPaymentMethodOptionsSofort $Sofort=null,
        /** @var SessionPaymentMethodOptionsSwish|null */
        public ?SessionPaymentMethodOptionsSwish $Swish=null,
        /** @var SessionPaymentMethodOptionsUsBankAccount|null */
        public ?SessionPaymentMethodOptionsUsBankAccount $UsBankAccount=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['AcssDebit'])) $this->AcssDebit = JsonConverters::from('SessionPaymentMethodOptionsAcssDebit', $o['AcssDebit']);
        if (isset($o['Affirm'])) $this->Affirm = JsonConverters::from('SessionPaymentMethodOptionsAffirm', $o['Affirm']);
        if (isset($o['AfterpayClearpay'])) $this->AfterpayClearpay = JsonConverters::from('SessionPaymentMethodOptionsAfterpayClearpay', $o['AfterpayClearpay']);
        if (isset($o['Alipay'])) $this->Alipay = JsonConverters::from('SessionPaymentMethodOptionsAlipay', $o['Alipay']);
        if (isset($o['AmazonPay'])) $this->AmazonPay = JsonConverters::from('SessionPaymentMethodOptionsAmazonPay', $o['AmazonPay']);
        if (isset($o['AuBecsDebit'])) $this->AuBecsDebit = JsonConverters::from('SessionPaymentMethodOptionsAuBecsDebit', $o['AuBecsDebit']);
        if (isset($o['BacsDebit'])) $this->BacsDebit = JsonConverters::from('SessionPaymentMethodOptionsBacsDebit', $o['BacsDebit']);
        if (isset($o['Bancontact'])) $this->Bancontact = JsonConverters::from('SessionPaymentMethodOptionsBancontact', $o['Bancontact']);
        if (isset($o['Boleto'])) $this->Boleto = JsonConverters::from('SessionPaymentMethodOptionsBoleto', $o['Boleto']);
        if (isset($o['Card'])) $this->Card = JsonConverters::from('SessionPaymentMethodOptionsCard', $o['Card']);
        if (isset($o['Cashapp'])) $this->Cashapp = JsonConverters::from('SessionPaymentMethodOptionsCashapp', $o['Cashapp']);
        if (isset($o['CustomerBalance'])) $this->CustomerBalance = JsonConverters::from('SessionPaymentMethodOptionsCustomerBalance', $o['CustomerBalance']);
        if (isset($o['Eps'])) $this->Eps = JsonConverters::from('SessionPaymentMethodOptionsEps', $o['Eps']);
        if (isset($o['Fpx'])) $this->Fpx = JsonConverters::from('SessionPaymentMethodOptionsFpx', $o['Fpx']);
        if (isset($o['Giropay'])) $this->Giropay = JsonConverters::from('SessionPaymentMethodOptionsGiropay', $o['Giropay']);
        if (isset($o['Grabpay'])) $this->Grabpay = JsonConverters::from('SessionPaymentMethodOptionsGrabpay', $o['Grabpay']);
        if (isset($o['Ideal'])) $this->Ideal = JsonConverters::from('SessionPaymentMethodOptionsIdeal', $o['Ideal']);
        if (isset($o['Klarna'])) $this->Klarna = JsonConverters::from('SessionPaymentMethodOptionsKlarna', $o['Klarna']);
        if (isset($o['Konbini'])) $this->Konbini = JsonConverters::from('SessionPaymentMethodOptionsKonbini', $o['Konbini']);
        if (isset($o['Link'])) $this->Link = JsonConverters::from('SessionPaymentMethodOptionsLink', $o['Link']);
        if (isset($o['Mobilepay'])) $this->Mobilepay = JsonConverters::from('SessionPaymentMethodOptionsMobilepay', $o['Mobilepay']);
        if (isset($o['Multibanco'])) $this->Multibanco = JsonConverters::from('SessionPaymentMethodOptionsMultibanco', $o['Multibanco']);
        if (isset($o['Oxxo'])) $this->Oxxo = JsonConverters::from('SessionPaymentMethodOptionsOxxo', $o['Oxxo']);
        if (isset($o['P24'])) $this->P24 = JsonConverters::from('SessionPaymentMethodOptionsP24', $o['P24']);
        if (isset($o['Paynow'])) $this->Paynow = JsonConverters::from('SessionPaymentMethodOptionsPaynow', $o['Paynow']);
        if (isset($o['Paypal'])) $this->Paypal = JsonConverters::from('SessionPaymentMethodOptionsPaypal', $o['Paypal']);
        if (isset($o['Pix'])) $this->Pix = JsonConverters::from('SessionPaymentMethodOptionsPix', $o['Pix']);
        if (isset($o['RevolutPay'])) $this->RevolutPay = JsonConverters::from('SessionPaymentMethodOptionsRevolutPay', $o['RevolutPay']);
        if (isset($o['SepaDebit'])) $this->SepaDebit = JsonConverters::from('SessionPaymentMethodOptionsSepaDebit', $o['SepaDebit']);
        if (isset($o['Sofort'])) $this->Sofort = JsonConverters::from('SessionPaymentMethodOptionsSofort', $o['Sofort']);
        if (isset($o['Swish'])) $this->Swish = JsonConverters::from('SessionPaymentMethodOptionsSwish', $o['Swish']);
        if (isset($o['UsBankAccount'])) $this->UsBankAccount = JsonConverters::from('SessionPaymentMethodOptionsUsBankAccount', $o['UsBankAccount']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->AcssDebit)) $o['AcssDebit'] = JsonConverters::to('SessionPaymentMethodOptionsAcssDebit', $this->AcssDebit);
        if (isset($this->Affirm)) $o['Affirm'] = JsonConverters::to('SessionPaymentMethodOptionsAffirm', $this->Affirm);
        if (isset($this->AfterpayClearpay)) $o['AfterpayClearpay'] = JsonConverters::to('SessionPaymentMethodOptionsAfterpayClearpay', $this->AfterpayClearpay);
        if (isset($this->Alipay)) $o['Alipay'] = JsonConverters::to('SessionPaymentMethodOptionsAlipay', $this->Alipay);
        if (isset($this->AmazonPay)) $o['AmazonPay'] = JsonConverters::to('SessionPaymentMethodOptionsAmazonPay', $this->AmazonPay);
        if (isset($this->AuBecsDebit)) $o['AuBecsDebit'] = JsonConverters::to('SessionPaymentMethodOptionsAuBecsDebit', $this->AuBecsDebit);
        if (isset($this->BacsDebit)) $o['BacsDebit'] = JsonConverters::to('SessionPaymentMethodOptionsBacsDebit', $this->BacsDebit);
        if (isset($this->Bancontact)) $o['Bancontact'] = JsonConverters::to('SessionPaymentMethodOptionsBancontact', $this->Bancontact);
        if (isset($this->Boleto)) $o['Boleto'] = JsonConverters::to('SessionPaymentMethodOptionsBoleto', $this->Boleto);
        if (isset($this->Card)) $o['Card'] = JsonConverters::to('SessionPaymentMethodOptionsCard', $this->Card);
        if (isset($this->Cashapp)) $o['Cashapp'] = JsonConverters::to('SessionPaymentMethodOptionsCashapp', $this->Cashapp);
        if (isset($this->CustomerBalance)) $o['CustomerBalance'] = JsonConverters::to('SessionPaymentMethodOptionsCustomerBalance', $this->CustomerBalance);
        if (isset($this->Eps)) $o['Eps'] = JsonConverters::to('SessionPaymentMethodOptionsEps', $this->Eps);
        if (isset($this->Fpx)) $o['Fpx'] = JsonConverters::to('SessionPaymentMethodOptionsFpx', $this->Fpx);
        if (isset($this->Giropay)) $o['Giropay'] = JsonConverters::to('SessionPaymentMethodOptionsGiropay', $this->Giropay);
        if (isset($this->Grabpay)) $o['Grabpay'] = JsonConverters::to('SessionPaymentMethodOptionsGrabpay', $this->Grabpay);
        if (isset($this->Ideal)) $o['Ideal'] = JsonConverters::to('SessionPaymentMethodOptionsIdeal', $this->Ideal);
        if (isset($this->Klarna)) $o['Klarna'] = JsonConverters::to('SessionPaymentMethodOptionsKlarna', $this->Klarna);
        if (isset($this->Konbini)) $o['Konbini'] = JsonConverters::to('SessionPaymentMethodOptionsKonbini', $this->Konbini);
        if (isset($this->Link)) $o['Link'] = JsonConverters::to('SessionPaymentMethodOptionsLink', $this->Link);
        if (isset($this->Mobilepay)) $o['Mobilepay'] = JsonConverters::to('SessionPaymentMethodOptionsMobilepay', $this->Mobilepay);
        if (isset($this->Multibanco)) $o['Multibanco'] = JsonConverters::to('SessionPaymentMethodOptionsMultibanco', $this->Multibanco);
        if (isset($this->Oxxo)) $o['Oxxo'] = JsonConverters::to('SessionPaymentMethodOptionsOxxo', $this->Oxxo);
        if (isset($this->P24)) $o['P24'] = JsonConverters::to('SessionPaymentMethodOptionsP24', $this->P24);
        if (isset($this->Paynow)) $o['Paynow'] = JsonConverters::to('SessionPaymentMethodOptionsPaynow', $this->Paynow);
        if (isset($this->Paypal)) $o['Paypal'] = JsonConverters::to('SessionPaymentMethodOptionsPaypal', $this->Paypal);
        if (isset($this->Pix)) $o['Pix'] = JsonConverters::to('SessionPaymentMethodOptionsPix', $this->Pix);
        if (isset($this->RevolutPay)) $o['RevolutPay'] = JsonConverters::to('SessionPaymentMethodOptionsRevolutPay', $this->RevolutPay);
        if (isset($this->SepaDebit)) $o['SepaDebit'] = JsonConverters::to('SessionPaymentMethodOptionsSepaDebit', $this->SepaDebit);
        if (isset($this->Sofort)) $o['Sofort'] = JsonConverters::to('SessionPaymentMethodOptionsSofort', $this->Sofort);
        if (isset($this->Swish)) $o['Swish'] = JsonConverters::to('SessionPaymentMethodOptionsSwish', $this->Swish);
        if (isset($this->UsBankAccount)) $o['UsBankAccount'] = JsonConverters::to('SessionPaymentMethodOptionsUsBankAccount', $this->UsBankAccount);
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of SessionPhoneNumberCollection
 */
class SessionPhoneNumberCollection extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Enabled=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionSavedPaymentMethodOptions
 */
class SessionSavedPaymentMethodOptions extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var array<string>|null */
        public ?array $AllowRedisplayFilters=null,
        /** @var string|null */
        public ?string $PaymentMethodRemove=null,
        /** @var string|null */
        public ?string $PaymentMethodSave=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['AllowRedisplayFilters'])) $this->AllowRedisplayFilters = JsonConverters::fromArray('string', $o['AllowRedisplayFilters']);
        if (isset($o['PaymentMethodRemove'])) $this->PaymentMethodRemove = $o['PaymentMethodRemove'];
        if (isset($o['PaymentMethodSave'])) $this->PaymentMethodSave = $o['PaymentMethodSave'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->AllowRedisplayFilters)) $o['AllowRedisplayFilters'] = JsonConverters::toArray('string', $this->AllowRedisplayFilters);
        if (isset($this->PaymentMethodRemove)) $o['PaymentMethodRemove'] = $this->PaymentMethodRemove;
        if (isset($this->PaymentMethodSave)) $o['PaymentMethodSave'] = $this->PaymentMethodSave;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of SessionShippingAddressCollection
 */
class SessionShippingAddressCollection extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var array<string>|null */
        public ?array $AllowedCountries=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionShippingCostTax
 */
class SessionShippingCostTax extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Amount=0,
        /** @var TaxRate|null */
        public ?TaxRate $Rate=null,
        /** @var string|null */
        public ?string $TaxabilityReason=null,
        /** @var int|null */
        public ?int $TaxableAmount=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionShippingCost
 */
class SessionShippingCost extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $AmountSubtotal=0,
        /** @var int */
        public int $AmountTax=0,
        /** @var int */
        public int $AmountTotal=0,
        /** @var array<SessionShippingCostTax>|null */
        public ?array $Taxes=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['AmountSubtotal'])) $this->AmountSubtotal = $o['AmountSubtotal'];
        if (isset($o['AmountTax'])) $this->AmountTax = $o['AmountTax'];
        if (isset($o['AmountTotal'])) $this->AmountTotal = $o['AmountTotal'];
        if (isset($o['Taxes'])) $this->Taxes = JsonConverters::fromArray('SessionShippingCostTax', $o['Taxes']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->AmountSubtotal)) $o['AmountSubtotal'] = $this->AmountSubtotal;
        if (isset($this->AmountTax)) $o['AmountTax'] = $this->AmountTax;
        if (isset($this->AmountTotal)) $o['AmountTotal'] = $this->AmountTotal;
        if (isset($this->Taxes)) $o['Taxes'] = JsonConverters::toArray('SessionShippingCostTax', $this->Taxes);
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of SessionShippingDetails
 */
class SessionShippingDetails extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var Address|null */
        public ?Address $Address=null,
        /** @var string|null */
        public ?string $Carrier=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var string|null */
        public ?string $TrackingNumber=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionShippingOption
 */
class SessionShippingOption extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ShippingAmount=0
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionTaxIdCollection
 */
class SessionTaxIdCollection extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Enabled=null,
        /** @var string|null */
        public ?string $Required=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionTotalDetailsBreakdownDiscount
 */
class SessionTotalDetailsBreakdownDiscount extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Amount=0,
        /** @var Discount|null */
        public ?Discount $Discount=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionTotalDetailsBreakdownTax
 */
class SessionTotalDetailsBreakdownTax extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Amount=0,
        /** @var TaxRate|null */
        public ?TaxRate $Rate=null,
        /** @var string|null */
        public ?string $TaxabilityReason=null,
        /** @var int|null */
        public ?int $TaxableAmount=null
    ) {
    }

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

/**
 * @template StripeEntity1 of SessionTotalDetailsBreakdown
 */
class SessionTotalDetailsBreakdown extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var array<SessionTotalDetailsBreakdownDiscount>|null */
        public ?array $Discounts=null,
        /** @var array<SessionTotalDetailsBreakdownTax>|null */
        public ?array $Taxes=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Discounts'])) $this->Discounts = JsonConverters::fromArray('SessionTotalDetailsBreakdownDiscount', $o['Discounts']);
        if (isset($o['Taxes'])) $this->Taxes = JsonConverters::fromArray('SessionTotalDetailsBreakdownTax', $o['Taxes']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Discounts)) $o['Discounts'] = JsonConverters::toArray('SessionTotalDetailsBreakdownDiscount', $this->Discounts);
        if (isset($this->Taxes)) $o['Taxes'] = JsonConverters::toArray('SessionTotalDetailsBreakdownTax', $this->Taxes);
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template StripeEntity1 of SessionTotalDetails
 */
class SessionTotalDetails extends StripeEntity1 implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $AmountDiscount=0,
        /** @var int|null */
        public ?int $AmountShipping=null,
        /** @var int */
        public int $AmountTax=0,
        /** @var SessionTotalDetailsBreakdown|null */
        public ?SessionTotalDetailsBreakdown $Breakdown=null
    ) {
    }

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

/**
 * @template StripeEntity1 of Session
 */
class Session extends StripeEntity1 implements IHasId, IHasMetadata, IHasObject, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Id=null,
        /** @var string|null */
        public ?string $Object=null,
        /** @var SessionAfterExpiration|null */
        public ?SessionAfterExpiration $AfterExpiration=null,
        /** @var bool|null */
        public ?bool $AllowPromotionCodes=null,
        /** @var int|null */
        public ?int $AmountSubtotal=null,
        /** @var int|null */
        public ?int $AmountTotal=null,
        /** @var SessionAutomaticTax|null */
        public ?SessionAutomaticTax $AutomaticTax=null,
        /** @var string|null */
        public ?string $BillingAddressCollection=null,
        /** @var string|null */
        public ?string $CancelUrl=null,
        /** @var string|null */
        public ?string $ClientReferenceId=null,
        /** @var string|null */
        public ?string $ClientSecret=null,
        /** @var SessionConsent|null */
        public ?SessionConsent $Consent=null,
        /** @var SessionConsentCollection|null */
        public ?SessionConsentCollection $ConsentCollection=null,
        /** @var DateTime */
        public DateTime $Created=new DateTime(),
        /** @var string|null */
        public ?string $Currency=null,
        /** @var SessionCurrencyConversion|null */
        public ?SessionCurrencyConversion $CurrencyConversion=null,
        /** @var array<SessionCustomField>|null */
        public ?array $CustomFields=null,
        /** @var SessionCustomText|null */
        public ?SessionCustomText $CustomText=null,
        /** @var string|null */
        public ?string $CustomerCreation=null,
        /** @var SessionCustomerDetails|null */
        public ?SessionCustomerDetails $CustomerDetails=null,
        /** @var string|null */
        public ?string $CustomerEmail=null,
        /** @var DateTime */
        public DateTime $ExpiresAt=new DateTime(),
        /** @var SessionInvoiceCreation|null */
        public ?SessionInvoiceCreation $InvoiceCreation=null,
        /** @var StripeList<LineItem>|null */
        public ?StripeList $LineItems=null,
        /** @var bool|null */
        public ?bool $Livemode=null,
        /** @var string|null */
        public ?string $Locale=null,
        /** @var array<string,string>|null */
        public ?array $Metadata=null,
        /** @var string|null */
        public ?string $Mode=null,
        /** @var string|null */
        public ?string $PaymentMethodCollection=null,
        /** @var SessionPaymentMethodConfigurationDetails|null */
        public ?SessionPaymentMethodConfigurationDetails $PaymentMethodConfigurationDetails=null,
        /** @var SessionPaymentMethodOptions|null */
        public ?SessionPaymentMethodOptions $PaymentMethodOptions=null,
        /** @var array<string>|null */
        public ?array $PaymentMethodTypes=null,
        /** @var string|null */
        public ?string $PaymentStatus=null,
        /** @var SessionPhoneNumberCollection|null */
        public ?SessionPhoneNumberCollection $PhoneNumberCollection=null,
        /** @var string|null */
        public ?string $RecoveredFrom=null,
        /** @var string|null */
        public ?string $RedirectOnCompletion=null,
        /** @var string|null */
        public ?string $ReturnUrl=null,
        /** @var SessionSavedPaymentMethodOptions|null */
        public ?SessionSavedPaymentMethodOptions $SavedPaymentMethodOptions=null,
        /** @var SessionShippingAddressCollection|null */
        public ?SessionShippingAddressCollection $ShippingAddressCollection=null,
        /** @var SessionShippingCost|null */
        public ?SessionShippingCost $ShippingCost=null,
        /** @var SessionShippingDetails|null */
        public ?SessionShippingDetails $ShippingDetails=null,
        /** @var array<SessionShippingOption>|null */
        public ?array $ShippingOptions=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var string|null */
        public ?string $SubmitType=null,
        /** @var string|null */
        public ?string $SuccessUrl=null,
        /** @var SessionTaxIdCollection|null */
        public ?SessionTaxIdCollection $TaxIdCollection=null,
        /** @var SessionTotalDetails|null */
        public ?SessionTotalDetails $TotalDetails=null,
        /** @var string|null */
        public ?string $UiMode=null,
        /** @var string|null */
        public ?string $Url=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Object'])) $this->Object = $o['Object'];
        if (isset($o['AfterExpiration'])) $this->AfterExpiration = JsonConverters::from('SessionAfterExpiration', $o['AfterExpiration']);
        if (isset($o['AllowPromotionCodes'])) $this->AllowPromotionCodes = $o['AllowPromotionCodes'];
        if (isset($o['AmountSubtotal'])) $this->AmountSubtotal = $o['AmountSubtotal'];
        if (isset($o['AmountTotal'])) $this->AmountTotal = $o['AmountTotal'];
        if (isset($o['AutomaticTax'])) $this->AutomaticTax = JsonConverters::from('SessionAutomaticTax', $o['AutomaticTax']);
        if (isset($o['BillingAddressCollection'])) $this->BillingAddressCollection = $o['BillingAddressCollection'];
        if (isset($o['CancelUrl'])) $this->CancelUrl = $o['CancelUrl'];
        if (isset($o['ClientReferenceId'])) $this->ClientReferenceId = $o['ClientReferenceId'];
        if (isset($o['ClientSecret'])) $this->ClientSecret = $o['ClientSecret'];
        if (isset($o['Consent'])) $this->Consent = JsonConverters::from('SessionConsent', $o['Consent']);
        if (isset($o['ConsentCollection'])) $this->ConsentCollection = JsonConverters::from('SessionConsentCollection', $o['ConsentCollection']);
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['Currency'])) $this->Currency = $o['Currency'];
        if (isset($o['CurrencyConversion'])) $this->CurrencyConversion = JsonConverters::from('SessionCurrencyConversion', $o['CurrencyConversion']);
        if (isset($o['CustomFields'])) $this->CustomFields = JsonConverters::fromArray('SessionCustomField', $o['CustomFields']);
        if (isset($o['CustomText'])) $this->CustomText = JsonConverters::from('SessionCustomText', $o['CustomText']);
        if (isset($o['CustomerCreation'])) $this->CustomerCreation = $o['CustomerCreation'];
        if (isset($o['CustomerDetails'])) $this->CustomerDetails = JsonConverters::from('SessionCustomerDetails', $o['CustomerDetails']);
        if (isset($o['CustomerEmail'])) $this->CustomerEmail = $o['CustomerEmail'];
        if (isset($o['ExpiresAt'])) $this->ExpiresAt = JsonConverters::from('DateTime', $o['ExpiresAt']);
        if (isset($o['InvoiceCreation'])) $this->InvoiceCreation = JsonConverters::from('SessionInvoiceCreation', $o['InvoiceCreation']);
        if (isset($o['LineItems'])) $this->LineItems = JsonConverters::from(JsonConverters::context('StripeList',genericArgs:['LineItem']), $o['LineItems']);
        if (isset($o['Livemode'])) $this->Livemode = $o['Livemode'];
        if (isset($o['Locale'])) $this->Locale = $o['Locale'];
        if (isset($o['Metadata'])) $this->Metadata = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Metadata']);
        if (isset($o['Mode'])) $this->Mode = $o['Mode'];
        if (isset($o['PaymentMethodCollection'])) $this->PaymentMethodCollection = $o['PaymentMethodCollection'];
        if (isset($o['PaymentMethodConfigurationDetails'])) $this->PaymentMethodConfigurationDetails = JsonConverters::from('SessionPaymentMethodConfigurationDetails', $o['PaymentMethodConfigurationDetails']);
        if (isset($o['PaymentMethodOptions'])) $this->PaymentMethodOptions = JsonConverters::from('SessionPaymentMethodOptions', $o['PaymentMethodOptions']);
        if (isset($o['PaymentMethodTypes'])) $this->PaymentMethodTypes = JsonConverters::fromArray('string', $o['PaymentMethodTypes']);
        if (isset($o['PaymentStatus'])) $this->PaymentStatus = $o['PaymentStatus'];
        if (isset($o['PhoneNumberCollection'])) $this->PhoneNumberCollection = JsonConverters::from('SessionPhoneNumberCollection', $o['PhoneNumberCollection']);
        if (isset($o['RecoveredFrom'])) $this->RecoveredFrom = $o['RecoveredFrom'];
        if (isset($o['RedirectOnCompletion'])) $this->RedirectOnCompletion = $o['RedirectOnCompletion'];
        if (isset($o['ReturnUrl'])) $this->ReturnUrl = $o['ReturnUrl'];
        if (isset($o['SavedPaymentMethodOptions'])) $this->SavedPaymentMethodOptions = JsonConverters::from('SessionSavedPaymentMethodOptions', $o['SavedPaymentMethodOptions']);
        if (isset($o['ShippingAddressCollection'])) $this->ShippingAddressCollection = JsonConverters::from('SessionShippingAddressCollection', $o['ShippingAddressCollection']);
        if (isset($o['ShippingCost'])) $this->ShippingCost = JsonConverters::from('SessionShippingCost', $o['ShippingCost']);
        if (isset($o['ShippingDetails'])) $this->ShippingDetails = JsonConverters::from('SessionShippingDetails', $o['ShippingDetails']);
        if (isset($o['ShippingOptions'])) $this->ShippingOptions = JsonConverters::fromArray('SessionShippingOption', $o['ShippingOptions']);
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['SubmitType'])) $this->SubmitType = $o['SubmitType'];
        if (isset($o['SuccessUrl'])) $this->SuccessUrl = $o['SuccessUrl'];
        if (isset($o['TaxIdCollection'])) $this->TaxIdCollection = JsonConverters::from('SessionTaxIdCollection', $o['TaxIdCollection']);
        if (isset($o['TotalDetails'])) $this->TotalDetails = JsonConverters::from('SessionTotalDetails', $o['TotalDetails']);
        if (isset($o['UiMode'])) $this->UiMode = $o['UiMode'];
        if (isset($o['Url'])) $this->Url = $o['Url'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Object)) $o['Object'] = $this->Object;
        if (isset($this->AfterExpiration)) $o['AfterExpiration'] = JsonConverters::to('SessionAfterExpiration', $this->AfterExpiration);
        if (isset($this->AllowPromotionCodes)) $o['AllowPromotionCodes'] = $this->AllowPromotionCodes;
        if (isset($this->AmountSubtotal)) $o['AmountSubtotal'] = $this->AmountSubtotal;
        if (isset($this->AmountTotal)) $o['AmountTotal'] = $this->AmountTotal;
        if (isset($this->AutomaticTax)) $o['AutomaticTax'] = JsonConverters::to('SessionAutomaticTax', $this->AutomaticTax);
        if (isset($this->BillingAddressCollection)) $o['BillingAddressCollection'] = $this->BillingAddressCollection;
        if (isset($this->CancelUrl)) $o['CancelUrl'] = $this->CancelUrl;
        if (isset($this->ClientReferenceId)) $o['ClientReferenceId'] = $this->ClientReferenceId;
        if (isset($this->ClientSecret)) $o['ClientSecret'] = $this->ClientSecret;
        if (isset($this->Consent)) $o['Consent'] = JsonConverters::to('SessionConsent', $this->Consent);
        if (isset($this->ConsentCollection)) $o['ConsentCollection'] = JsonConverters::to('SessionConsentCollection', $this->ConsentCollection);
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->Currency)) $o['Currency'] = $this->Currency;
        if (isset($this->CurrencyConversion)) $o['CurrencyConversion'] = JsonConverters::to('SessionCurrencyConversion', $this->CurrencyConversion);
        if (isset($this->CustomFields)) $o['CustomFields'] = JsonConverters::toArray('SessionCustomField', $this->CustomFields);
        if (isset($this->CustomText)) $o['CustomText'] = JsonConverters::to('SessionCustomText', $this->CustomText);
        if (isset($this->CustomerCreation)) $o['CustomerCreation'] = $this->CustomerCreation;
        if (isset($this->CustomerDetails)) $o['CustomerDetails'] = JsonConverters::to('SessionCustomerDetails', $this->CustomerDetails);
        if (isset($this->CustomerEmail)) $o['CustomerEmail'] = $this->CustomerEmail;
        if (isset($this->ExpiresAt)) $o['ExpiresAt'] = JsonConverters::to('DateTime', $this->ExpiresAt);
        if (isset($this->InvoiceCreation)) $o['InvoiceCreation'] = JsonConverters::to('SessionInvoiceCreation', $this->InvoiceCreation);
        if (isset($this->LineItems)) $o['LineItems'] = JsonConverters::to(JsonConverters::context('StripeList',genericArgs:['LineItem']), $this->LineItems);
        if (isset($this->Livemode)) $o['Livemode'] = $this->Livemode;
        if (isset($this->Locale)) $o['Locale'] = $this->Locale;
        if (isset($this->Metadata)) $o['Metadata'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Metadata);
        if (isset($this->Mode)) $o['Mode'] = $this->Mode;
        if (isset($this->PaymentMethodCollection)) $o['PaymentMethodCollection'] = $this->PaymentMethodCollection;
        if (isset($this->PaymentMethodConfigurationDetails)) $o['PaymentMethodConfigurationDetails'] = JsonConverters::to('SessionPaymentMethodConfigurationDetails', $this->PaymentMethodConfigurationDetails);
        if (isset($this->PaymentMethodOptions)) $o['PaymentMethodOptions'] = JsonConverters::to('SessionPaymentMethodOptions', $this->PaymentMethodOptions);
        if (isset($this->PaymentMethodTypes)) $o['PaymentMethodTypes'] = JsonConverters::toArray('string', $this->PaymentMethodTypes);
        if (isset($this->PaymentStatus)) $o['PaymentStatus'] = $this->PaymentStatus;
        if (isset($this->PhoneNumberCollection)) $o['PhoneNumberCollection'] = JsonConverters::to('SessionPhoneNumberCollection', $this->PhoneNumberCollection);
        if (isset($this->RecoveredFrom)) $o['RecoveredFrom'] = $this->RecoveredFrom;
        if (isset($this->RedirectOnCompletion)) $o['RedirectOnCompletion'] = $this->RedirectOnCompletion;
        if (isset($this->ReturnUrl)) $o['ReturnUrl'] = $this->ReturnUrl;
        if (isset($this->SavedPaymentMethodOptions)) $o['SavedPaymentMethodOptions'] = JsonConverters::to('SessionSavedPaymentMethodOptions', $this->SavedPaymentMethodOptions);
        if (isset($this->ShippingAddressCollection)) $o['ShippingAddressCollection'] = JsonConverters::to('SessionShippingAddressCollection', $this->ShippingAddressCollection);
        if (isset($this->ShippingCost)) $o['ShippingCost'] = JsonConverters::to('SessionShippingCost', $this->ShippingCost);
        if (isset($this->ShippingDetails)) $o['ShippingDetails'] = JsonConverters::to('SessionShippingDetails', $this->ShippingDetails);
        if (isset($this->ShippingOptions)) $o['ShippingOptions'] = JsonConverters::toArray('SessionShippingOption', $this->ShippingOptions);
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->SubmitType)) $o['SubmitType'] = $this->SubmitType;
        if (isset($this->SuccessUrl)) $o['SuccessUrl'] = $this->SuccessUrl;
        if (isset($this->TaxIdCollection)) $o['TaxIdCollection'] = JsonConverters::to('SessionTaxIdCollection', $this->TaxIdCollection);
        if (isset($this->TotalDetails)) $o['TotalDetails'] = JsonConverters::to('SessionTotalDetails', $this->TotalDetails);
        if (isset($this->UiMode)) $o['UiMode'] = $this->UiMode;
        if (isset($this->Url)) $o['Url'] = $this->Url;
        return empty($o) ? new class(){} : $o;
    }
}

interface IPaysonPaymentCheckout1
{
}

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 string */
        public string $InternalReferenceId='',

        // @Required()
        /** @var int */
        public int $ArticleTypeId=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['InternalReferenceId'])) $this->InternalReferenceId = $o['InternalReferenceId'];
        if (isset($o['ArticleTypeId'])) $this->ArticleTypeId = $o['ArticleTypeId'];
        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->InternalReferenceId)) $o['InternalReferenceId'] = $this->InternalReferenceId;
        if (isset($this->ArticleTypeId)) $o['ArticleTypeId'] = $this->ArticleTypeId;
        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 PayableEntity extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var IDbConnectionFactory|null */
        public ?IDbConnectionFactory $DbFactory=null,

        // @Ignore()
        /** @var IBokameraPaymentManager3<InitCheckoutRequestBody, QvicklyCheckoutResponse, QvicklyPaymentResponse>|null */
        public ?IBokameraPaymentManager3 $QvicklyPaymentManager=null,

        // @Ignore()
        /** @var IBokameraPaymentManager3<Payson2CheckoutResponse, Payson2CheckoutResponse, Payson2CheckoutResponse>|null */
        public ?IBokameraPaymentManager3 $Payson2PaymentManager=null,

        // @Ignore()
        /** @var IBokameraPaymentManager3<SessionCreateOptions, Session, Session>|null */
        public ?IBokameraPaymentManager3 $StripePaymentManager=null,

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

        // @Ignore()
        /** @var ILogger<PayableEntity>|null */
        public ?ILogger $Logger=null,

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

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

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

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

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

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

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['DbFactory'])) $this->DbFactory = JsonConverters::from('IDbConnectionFactory', $o['DbFactory']);
        if (isset($o['QvicklyPaymentManager'])) $this->QvicklyPaymentManager = JsonConverters::from(JsonConverters::context('IBokameraPaymentManager3',genericArgs:['InitCheckoutRequestBody','QvicklyCheckoutResponse','QvicklyPaymentResponse']), $o['QvicklyPaymentManager']);
        if (isset($o['Payson2PaymentManager'])) $this->Payson2PaymentManager = JsonConverters::from(JsonConverters::context('IBokameraPaymentManager3',genericArgs:['Payson2CheckoutResponse','Payson2CheckoutResponse','Payson2CheckoutResponse']), $o['Payson2PaymentManager']);
        if (isset($o['StripePaymentManager'])) $this->StripePaymentManager = JsonConverters::from(JsonConverters::context('IBokameraPaymentManager3',genericArgs:['SessionCreateOptions','Session','Session']), $o['StripePaymentManager']);
        if (isset($o['PaysonPaymentCheckout1'])) $this->PaysonPaymentCheckout1 = JsonConverters::from('IPaysonPaymentCheckout1', $o['PaysonPaymentCheckout1']);
        if (isset($o['Logger'])) $this->Logger = JsonConverters::from(JsonConverters::context('ILogger',genericArgs:['PayableEntity']), $o['Logger']);
        if (isset($o['InternalReferenceId'])) $this->InternalReferenceId = $o['InternalReferenceId'];
        if (isset($o['PaymentLog'])) $this->PaymentLog = JsonConverters::fromArray('PaymentLog', $o['PaymentLog']);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['PriceVat'])) $this->PriceVat = $o['PriceVat'];
        if (isset($o['CurrencyId'])) $this->CurrencyId = $o['CurrencyId'];
        if (isset($o['Customer'])) $this->Customer = JsonConverters::from('Customer', $o['Customer']);
        if (isset($o['Customers'])) $this->Customers = JsonConverters::fromArray('Customer', $o['Customers']);
        if (isset($o['Company'])) $this->Company = JsonConverters::from('Company', $o['Company']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->DbFactory)) $o['DbFactory'] = JsonConverters::to('IDbConnectionFactory', $this->DbFactory);
        if (isset($this->QvicklyPaymentManager)) $o['QvicklyPaymentManager'] = JsonConverters::to(JsonConverters::context('IBokameraPaymentManager3',genericArgs:['InitCheckoutRequestBody','QvicklyCheckoutResponse','QvicklyPaymentResponse']), $this->QvicklyPaymentManager);
        if (isset($this->Payson2PaymentManager)) $o['Payson2PaymentManager'] = JsonConverters::to(JsonConverters::context('IBokameraPaymentManager3',genericArgs:['Payson2CheckoutResponse','Payson2CheckoutResponse','Payson2CheckoutResponse']), $this->Payson2PaymentManager);
        if (isset($this->StripePaymentManager)) $o['StripePaymentManager'] = JsonConverters::to(JsonConverters::context('IBokameraPaymentManager3',genericArgs:['SessionCreateOptions','Session','Session']), $this->StripePaymentManager);
        if (isset($this->PaysonPaymentCheckout1)) $o['PaysonPaymentCheckout1'] = JsonConverters::to('IPaysonPaymentCheckout1', $this->PaysonPaymentCheckout1);
        if (isset($this->Logger)) $o['Logger'] = JsonConverters::to(JsonConverters::context('ILogger',genericArgs:['PayableEntity']), $this->Logger);
        if (isset($this->InternalReferenceId)) $o['InternalReferenceId'] = $this->InternalReferenceId;
        if (isset($this->PaymentLog)) $o['PaymentLog'] = JsonConverters::toArray('PaymentLog', $this->PaymentLog);
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->PriceVat)) $o['PriceVat'] = $this->PriceVat;
        if (isset($this->CurrencyId)) $o['CurrencyId'] = $this->CurrencyId;
        if (isset($this->Customer)) $o['Customer'] = JsonConverters::to('Customer', $this->Customer);
        if (isset($this->Customers)) $o['Customers'] = JsonConverters::toArray('Customer', $this->Customers);
        if (isset($this->Company)) $o['Company'] = JsonConverters::to('Company', $this->Company);
        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 ArticleServiceRelation extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $CompanyId='',

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

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

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

enum ArticleTypeEnum : int
{
    case ServiceArticle = 1;
    case StandAloneArticle = 2;
    case RebateCodePunchTicketArticle = 3;
    case RebateCodeGiftCardArticle = 4;
    case RebateCodeValueCardArticle = 5;
}

class Article extends BaseModel implements IBaseModelCreated, IBaseModelUpdated, JsonSerializable
{
    public function __construct(
        /** @var Company|null */
        public ?Company $Company=null,
        /** @var Currency|null */
        public ?Currency $CurrencyInfo=null,
        /** @var array<ArticleServiceRelation>|null */
        public ?array $ArticleServiceRelations=null,
        // @Ignore()
        /** @var array<int>|null */
        public ?array $ServiceIds=null,

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

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

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

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

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

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

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

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

        // @Required()
        // @StringLength(50)
        /** @var string */
        public string $CurrencyId='',

        // @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['Company'])) $this->Company = JsonConverters::from('Company', $o['Company']);
        if (isset($o['CurrencyInfo'])) $this->CurrencyInfo = JsonConverters::from('Currency', $o['CurrencyInfo']);
        if (isset($o['ArticleServiceRelations'])) $this->ArticleServiceRelations = JsonConverters::fromArray('ArticleServiceRelation', $o['ArticleServiceRelations']);
        if (isset($o['ServiceIds'])) $this->ServiceIds = JsonConverters::fromArray('int', $o['ServiceIds']);
        if (isset($o['ArticleType'])) $this->ArticleType = JsonConverters::from('ArticleTypeEnum', $o['ArticleType']);
        if (isset($o['ArticleTypeName'])) $this->ArticleTypeName = $o['ArticleTypeName'];
        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['ArticleTypeId'])) $this->ArticleTypeId = $o['ArticleTypeId'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ImageUrl'])) $this->ImageUrl = $o['ImageUrl'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['Amount'])) $this->Amount = $o['Amount'];
        if (isset($o['Price'])) $this->Price = $o['Price'];
        if (isset($o['CurrencyId'])) $this->CurrencyId = $o['CurrencyId'];
        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->Company)) $o['Company'] = JsonConverters::to('Company', $this->Company);
        if (isset($this->CurrencyInfo)) $o['CurrencyInfo'] = JsonConverters::to('Currency', $this->CurrencyInfo);
        if (isset($this->ArticleServiceRelations)) $o['ArticleServiceRelations'] = JsonConverters::toArray('ArticleServiceRelation', $this->ArticleServiceRelations);
        if (isset($this->ServiceIds)) $o['ServiceIds'] = JsonConverters::toArray('int', $this->ServiceIds);
        if (isset($this->ArticleType)) $o['ArticleType'] = JsonConverters::to('ArticleTypeEnum', $this->ArticleType);
        if (isset($this->ArticleTypeName)) $o['ArticleTypeName'] = $this->ArticleTypeName;
        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->ArticleTypeId)) $o['ArticleTypeId'] = $this->ArticleTypeId;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ImageUrl)) $o['ImageUrl'] = $this->ImageUrl;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->Amount)) $o['Amount'] = $this->Amount;
        if (isset($this->Price)) $o['Price'] = $this->Price;
        if (isset($this->CurrencyId)) $o['CurrencyId'] = $this->CurrencyId;
        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;
    }
}

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,
        /** @var bool|null */
        public ?bool $RebateCodeEmailSentToCustomer=null,
        /** @var string|null */
        public ?string $MessageToReceiver=null,
        /** @var bool|null */
        public ?bool $Buyer=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']);
        if (isset($o['RebateCodeEmailSentToCustomer'])) $this->RebateCodeEmailSentToCustomer = $o['RebateCodeEmailSentToCustomer'];
        if (isset($o['MessageToReceiver'])) $this->MessageToReceiver = $o['MessageToReceiver'];
        if (isset($o['Buyer'])) $this->Buyer = $o['Buyer'];
    }
    
    /** @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);
        if (isset($this->RebateCodeEmailSentToCustomer)) $o['RebateCodeEmailSentToCustomer'] = $this->RebateCodeEmailSentToCustomer;
        if (isset($this->MessageToReceiver)) $o['MessageToReceiver'] = $this->MessageToReceiver;
        if (isset($this->Buyer)) $o['Buyer'] = $this->Buyer;
        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 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 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 string */
        public string $InternalReferenceId='',

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

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

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

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

        // @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['InternalReferenceId'])) $this->InternalReferenceId = $o['InternalReferenceId'];
        if (isset($o['ArticleTypeId'])) $this->ArticleTypeId = $o['ArticleTypeId'];
        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['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->InternalReferenceId)) $o['InternalReferenceId'] = $this->InternalReferenceId;
        if (isset($this->ArticleTypeId)) $o['ArticleTypeId'] = $this->ArticleTypeId;
        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->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;
    }
}

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 PayableEntity implements IInterval, ICustomFieldTable, IBaseModelUpdated, IBaseModelCreated, JsonSerializable
{
    /**
     * @param IDbConnectionFactory|null $DbFactory
     * @param IBokameraPaymentManager3<InitCheckoutRequestBody, QvicklyCheckoutResponse, QvicklyPaymentResponse>|null $QvicklyPaymentManager
     * @param IBokameraPaymentManager3<Payson2CheckoutResponse, Payson2CheckoutResponse, Payson2CheckoutResponse>|null $Payson2PaymentManager
     * @param IBokameraPaymentManager3<SessionCreateOptions, Session, Session>|null $StripePaymentManager
     * @param IPaysonPaymentCheckout1|null $PaysonPaymentCheckout1
     * @param ILogger<PayableEntity>|null $Logger
     * @param string|null $InternalReferenceId
     * @param array<PaymentLog>|null $PaymentLog
     * @param string $CompanyId
     * @param float|null $PriceVat
     * @param string|null $CurrencyId
     * @param Customer|null $Customer
     * @param array<Customer>|null $Customers
     * @param Company|null $Company
     */
    public function __construct(
        ?IDbConnectionFactory $DbFactory=null,
        ?IBokameraPaymentManager3 $QvicklyPaymentManager=null,
        ?IBokameraPaymentManager3 $Payson2PaymentManager=null,
        ?IBokameraPaymentManager3 $StripePaymentManager=null,
        ?IPaysonPaymentCheckout1 $PaysonPaymentCheckout1=null,
        ?ILogger $Logger=null,
        ?string $InternalReferenceId=null,
        ?array $PaymentLog=null,
        string $CompanyId='',
        ?float $PriceVat=null,
        ?string $CurrencyId=null,
        ?Customer $Customer=null,
        ?array $Customers=null,
        ?Company $Company=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<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,

        /** @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 string */
        public string $DeterministicId='',

        // @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(),

        /** @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,
        // @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()
    ) {
        parent::__construct($DbFactory,$QvicklyPaymentManager,$Payson2PaymentManager,$StripePaymentManager,$PaysonPaymentCheckout1,$Logger,$InternalReferenceId,$PaymentLog,$CompanyId,$PriceVat,$CurrencyId,$Customer,$Customers,$Company);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        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['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['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['DeterministicId'])) $this->DeterministicId = $o['DeterministicId'];
        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['InternalReferenceId'])) $this->InternalReferenceId = $o['InternalReferenceId'];
        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['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['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->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->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->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->DeterministicId)) $o['DeterministicId'] = $this->DeterministicId;
        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->InternalReferenceId)) $o['InternalReferenceId'] = $this->InternalReferenceId;
        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->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->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 RebateCodeTransaction extends BaseModel implements IBaseModelCreated, IBaseModelUpdated, JsonSerializable
{
    public function __construct(
        // @Ignore()
        /** @var Booking|null */
        public ?Booking $Booking=null,

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

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

        /** @var int */
        public int $Id=0,
        /** @var string */
        public string $CompanyId='',
        /** @var string|null */
        public ?string $Note=null,
        // @Required()
        /** @var int */
        public int $RebateCodeId=0,

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

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

        /** @var int|null */
        public ?int $BookingId=null,
        // @Required()
        /** @var DateTime */
        public DateTime $UpdatedDate=new DateTime(),

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

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Booking'])) $this->Booking = JsonConverters::from('Booking', $o['Booking']);
        if (isset($o['RebateCode'])) $this->RebateCode = JsonConverters::from('RebateCode', $o['RebateCode']);
        if (isset($o['Customer'])) $this->Customer = JsonConverters::from('Customer', $o['Customer']);
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Note'])) $this->Note = $o['Note'];
        if (isset($o['RebateCodeId'])) $this->RebateCodeId = $o['RebateCodeId'];
        if (isset($o['Amount'])) $this->Amount = $o['Amount'];
        if (isset($o['Usage'])) $this->Usage = $o['Usage'];
        if (isset($o['BookingId'])) $this->BookingId = $o['BookingId'];
        if (isset($o['UpdatedDate'])) $this->UpdatedDate = JsonConverters::from('DateTime', $o['UpdatedDate']);
        if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Booking)) $o['Booking'] = JsonConverters::to('Booking', $this->Booking);
        if (isset($this->RebateCode)) $o['RebateCode'] = JsonConverters::to('RebateCode', $this->RebateCode);
        if (isset($this->Customer)) $o['Customer'] = JsonConverters::to('Customer', $this->Customer);
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Note)) $o['Note'] = $this->Note;
        if (isset($this->RebateCodeId)) $o['RebateCodeId'] = $this->RebateCodeId;
        if (isset($this->Amount)) $o['Amount'] = $this->Amount;
        if (isset($this->Usage)) $o['Usage'] = $this->Usage;
        if (isset($this->BookingId)) $o['BookingId'] = $this->BookingId;
        if (isset($this->UpdatedDate)) $o['UpdatedDate'] = JsonConverters::to('DateTime', $this->UpdatedDate);
        if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
        return empty($o) ? new class(){} : $o;
    }
}

class RebateCode extends PayableEntity implements JsonSerializable
{
    /**
     * @param IDbConnectionFactory|null $DbFactory
     * @param IBokameraPaymentManager3<InitCheckoutRequestBody, QvicklyCheckoutResponse, QvicklyPaymentResponse>|null $QvicklyPaymentManager
     * @param IBokameraPaymentManager3<Payson2CheckoutResponse, Payson2CheckoutResponse, Payson2CheckoutResponse>|null $Payson2PaymentManager
     * @param IBokameraPaymentManager3<SessionCreateOptions, Session, Session>|null $StripePaymentManager
     * @param IPaysonPaymentCheckout1|null $PaysonPaymentCheckout1
     * @param ILogger<PayableEntity>|null $Logger
     * @param string|null $InternalReferenceId
     * @param array<PaymentLog>|null $PaymentLog
     * @param string $CompanyId
     * @param float|null $PriceVat
     * @param string|null $CurrencyId
     * @param Customer|null $Customer
     * @param array<Customer>|null $Customers
     * @param Company|null $Company
     */
    public function __construct(
        ?IDbConnectionFactory $DbFactory=null,
        ?IBokameraPaymentManager3 $QvicklyPaymentManager=null,
        ?IBokameraPaymentManager3 $Payson2PaymentManager=null,
        ?IBokameraPaymentManager3 $StripePaymentManager=null,
        ?IPaysonPaymentCheckout1 $PaysonPaymentCheckout1=null,
        ?ILogger $Logger=null,
        ?string $InternalReferenceId=null,
        ?array $PaymentLog=null,
        string $CompanyId='',
        ?float $PriceVat=null,
        ?string $CurrencyId=null,
        ?Customer $Customer=null,
        ?array $Customers=null,
        ?Company $Company=null,
        // @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 RebateCodeStatus|null */
        public ?RebateCodeStatus $RebateCodeStatusInfo=null,
        // @Ignore()
        /** @var Article|null */
        public ?Article $Article=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 string|null */
        public ?string $ServicesNames=null,

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

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

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

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

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

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

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

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

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

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

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

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

        // @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 $UpdatedDate=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,
        /** @var int|null */
        public ?int $ArticleId=null
    ) {
        parent::__construct($DbFactory,$QvicklyPaymentManager,$Payson2PaymentManager,$StripePaymentManager,$PaysonPaymentCheckout1,$Logger,$InternalReferenceId,$PaymentLog,$CompanyId,$PriceVat,$CurrencyId,$Customer,$Customers,$Company);
    }

    /** @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('RebateCodeStatus', $o['RebateCodeStatusInfo']);
        if (isset($o['Article'])) $this->Article = JsonConverters::from('Article', $o['Article']);
        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['ServicesNames'])) $this->ServicesNames = $o['ServicesNames'];
        if (isset($o['DaysOfWeek'])) $this->DaysOfWeek = JsonConverters::fromArray('DaysOfWeek', $o['DaysOfWeek']);
        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['Transactions'])) $this->Transactions = JsonConverters::fromArray('RebateCodeTransaction', $o['Transactions']);
        if (isset($o['RemainingAmount'])) $this->RemainingAmount = $o['RemainingAmount'];
        if (isset($o['RemainingUsage'])) $this->RemainingUsage = $o['RemainingUsage'];
        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['ActiveByStatus'])) $this->ActiveByStatus = $o['ActiveByStatus'];
        if (isset($o['RebateCodeCurrencySign'])) $this->RebateCodeCurrencySign = $o['RebateCodeCurrencySign'];
        if (isset($o['CurrencyInfo'])) $this->CurrencyInfo = JsonConverters::from('Currency', $o['CurrencyInfo']);
        if (isset($o['PaymentReceived'])) $this->PaymentReceived = $o['PaymentReceived'];
        if (isset($o['InternalReferenceId'])) $this->InternalReferenceId = $o['InternalReferenceId'];
        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['UpdatedDate'])) $this->UpdatedDate = JsonConverters::from('DateTime', $o['UpdatedDate']);
        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'];
        if (isset($o['ArticleId'])) $this->ArticleId = $o['ArticleId'];
    }
    
    /** @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('RebateCodeStatus', $this->RebateCodeStatusInfo);
        if (isset($this->Article)) $o['Article'] = JsonConverters::to('Article', $this->Article);
        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->ServicesNames)) $o['ServicesNames'] = $this->ServicesNames;
        if (isset($this->DaysOfWeek)) $o['DaysOfWeek'] = JsonConverters::toArray('DaysOfWeek', $this->DaysOfWeek);
        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->Transactions)) $o['Transactions'] = JsonConverters::toArray('RebateCodeTransaction', $this->Transactions);
        if (isset($this->RemainingAmount)) $o['RemainingAmount'] = $this->RemainingAmount;
        if (isset($this->RemainingUsage)) $o['RemainingUsage'] = $this->RemainingUsage;
        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->ActiveByStatus)) $o['ActiveByStatus'] = $this->ActiveByStatus;
        if (isset($this->RebateCodeCurrencySign)) $o['RebateCodeCurrencySign'] = $this->RebateCodeCurrencySign;
        if (isset($this->CurrencyInfo)) $o['CurrencyInfo'] = JsonConverters::to('Currency', $this->CurrencyInfo);
        if (isset($this->PaymentReceived)) $o['PaymentReceived'] = $this->PaymentReceived;
        if (isset($this->InternalReferenceId)) $o['InternalReferenceId'] = $this->InternalReferenceId;
        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->UpdatedDate)) $o['UpdatedDate'] = JsonConverters::to('DateTime', $this->UpdatedDate);
        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;
        if (isset($this->ArticleId)) $o['ArticleId'] = $this->ArticleId;
        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 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['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->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 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 $MinNumberOfSpotsPerBooking=0,

        // @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['MinNumberOfSpotsPerBooking'])) $this->MinNumberOfSpotsPerBooking = $o['MinNumberOfSpotsPerBooking'];
        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->MinNumberOfSpotsPerBooking)) $o['MinNumberOfSpotsPerBooking'] = $this->MinNumberOfSpotsPerBooking;
        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;
    }
}

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

class ServiceSchedules implements JsonSerializable
{
    public function __construct(
        /** @var ScheduleType|null */
        public ?ScheduleType $ScheduleType=null,
        /** @var array<ISchedule>|null */
        public ?array $RecurringSchedules=null,
        /** @var array<ISchedule>|null */
        public ?array $DateSchedules=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ScheduleType'])) $this->ScheduleType = JsonConverters::from('ScheduleType', $o['ScheduleType']);
        if (isset($o['RecurringSchedules'])) $this->RecurringSchedules = JsonConverters::fromArray('ISchedule', $o['RecurringSchedules']);
        if (isset($o['DateSchedules'])) $this->DateSchedules = JsonConverters::fromArray('ISchedule', $o['DateSchedules']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ScheduleType)) $o['ScheduleType'] = JsonConverters::to('ScheduleType', $this->ScheduleType);
        if (isset($this->RecurringSchedules)) $o['RecurringSchedules'] = JsonConverters::toArray('ISchedule', $this->RecurringSchedules);
        if (isset($this->DateSchedules)) $o['DateSchedules'] = JsonConverters::toArray('ISchedule', $this->DateSchedules);
        return empty($o) ? new class(){} : $o;
    }
}

class CompanyRatingSummary implements JsonSerializable
{
    public function __construct(
        /** @description The average rating score */
        // @ApiMember(Description="The average rating score")
        /** @var float */
        public float $AverageScore=0.0,

        /** @description The number of ratings of score 1 */
        // @ApiMember(Description="The number of ratings of score 1")
        /** @var int */
        public int $RatingScore1Count=0,

        /** @description The number of ratings of score 2 */
        // @ApiMember(Description="The number of ratings of score 2")
        /** @var int */
        public int $RatingScore2Count=0,

        /** @description The number of ratings of score 3 */
        // @ApiMember(Description="The number of ratings of score 3")
        /** @var int */
        public int $RatingScore3Count=0,

        /** @description The number of ratings of score 4 */
        // @ApiMember(Description="The number of ratings of score 4")
        /** @var int */
        public int $RaingScore4Count=0,

        /** @description The number of ratings of score 5 */
        // @ApiMember(Description="The number of ratings of score 5")
        /** @var int */
        public int $RatingScore5Count=0,

        /** @description The number of ratings */
        // @ApiMember(Description="The number of ratings")
        /** @var int */
        public int $Count=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AverageScore'])) $this->AverageScore = $o['AverageScore'];
        if (isset($o['RatingScore1Count'])) $this->RatingScore1Count = $o['RatingScore1Count'];
        if (isset($o['RatingScore2Count'])) $this->RatingScore2Count = $o['RatingScore2Count'];
        if (isset($o['RatingScore3Count'])) $this->RatingScore3Count = $o['RatingScore3Count'];
        if (isset($o['RaingScore4Count'])) $this->RaingScore4Count = $o['RaingScore4Count'];
        if (isset($o['RatingScore5Count'])) $this->RatingScore5Count = $o['RatingScore5Count'];
        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->RatingScore1Count)) $o['RatingScore1Count'] = $this->RatingScore1Count;
        if (isset($this->RatingScore2Count)) $o['RatingScore2Count'] = $this->RatingScore2Count;
        if (isset($this->RatingScore3Count)) $o['RatingScore3Count'] = $this->RatingScore3Count;
        if (isset($this->RaingScore4Count)) $o['RaingScore4Count'] = $this->RaingScore4Count;
        if (isset($this->RatingScore5Count)) $o['RatingScore5Count'] = $this->RatingScore5Count;
        if (isset($this->Count)) $o['Count'] = $this->Count;
        return empty($o) ? new class(){} : $o;
    }
}

class RatingReviewResponse implements JsonSerializable
{
    public function __construct(
        /** @description The title for the review */
        // @ApiMember(Description="The title for the review")
        /** @var string|null */
        public ?string $Title=null,

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

        /** @description The rating score */
        // @ApiMember(Description="The rating score")
        /** @var int */
        public int $RatingScore=0,

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

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

        /** @description The review answer from the company */
        // @ApiMember(Description="The review answer from the company")
        /** @var string|null */
        public ?string $ReviewAnswer=null
    ) {
    }

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

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

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

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

        /** @description The resource 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['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->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 ServiceResourceTypeResponse implements JsonSerializable
{
    public function __construct(
        /** @description The resourcetype id */
        // @ApiMember(Description="The resourcetype id")
        /** @var int */
        public int $Id=0,

        /** @description The resourcetype is selectable by customer */
        // @ApiMember(Description="The resourcetype is selectable by customer")
        /** @var bool|null */
        public ?bool $SelectableByUser=null,

        /** @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<ServiceResourceTypeResource>|null */
        public ?array $Resources=null
    ) {
    }

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

class ServiceQueryResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $ImageUrl=null,
        /** @var int */
        public int $TotalSpots=0,
        /** @description If this setting is turned on the remaining spots (if Totalspots > 1) is locked from be booked by another customer. */
        // @ApiMember(Description="If this setting is turned on the remaining spots (if Totalspots > 1) is locked from be booked by another customer.")
        /** @var bool|null */
        public ?bool $LockSpotsToBooking=null,

        /** @var int */
        public int $MinNumberOfSpotsPerBooking=0,
        /** @var int */
        public int $MaxNumberOfSpotsPerBooking=0,
        /** @var int */
        public int $MinNumberOfResourcesToBook=0,
        /** @var int */
        public int $MaxNumberOfResourcesToBook=0,
        /** @var int */
        public int $UnbookBeforeDays=0,
        /** @var int */
        public int $UnbookBeforeHours=0,
        /** @var int */
        public int $UnbookBeforeMinutes=0,
        /** @description What type of schedule is connected to the service.  RecurringSchedule = 1, DateSchedule = 2 */
        // @ApiMember(Description="What type of schedule is connected to the service.  RecurringSchedule = 1, DateSchedule = 2")
        /** @var ScheduleType|null */
        public ?ScheduleType $ScheduleType=null,

        /** @description What type of schedule is connected to the service.  RecurringSchedule = 1, DateSchedule = 2 */
        // @ApiMember(Description="What type of schedule is connected to the service.  RecurringSchedule = 1, DateSchedule = 2")
        /** @var int */
        public int $ScheduleTypeId=0,

        /** @var int */
        public int $BookBeforeDays=0,
        /** @var int */
        public int $BookBeforeHours=0,
        /** @var int */
        public int $BookBeforeMinutes=0,
        /** @var string|null */
        public ?string $Group=null,
        /** @var bool|null */
        public ?bool $EnableBookingQueue=null,
        /** @var bool|null */
        public ?bool $EnableCodeLockSync=null,
        /** @var bool|null */
        public ?bool $EnableCustomerManualPayment=null,
        /** @var int */
        public int $SortOrder=0,
        /** @var bool|null */
        public ?bool $Active=null,
        /** @var bool|null */
        public ?bool $IsGroupBooking=null,
        /** @var GroupBookingSettings|null */
        public ?GroupBookingSettings $GroupBooking=null,
        /** @var MultipleResourceSettings|null */
        public ?MultipleResourceSettings $MultipleResource=null,
        /** @var bool|null */
        public ?bool $IsPaymentEnabled=null,
        /** @description Maximum numbers of minutes the booking payment must be completed before automatically unbooked */
        // @ApiMember(Description="Maximum numbers of minutes the booking payment must be completed before automatically unbooked")
        /** @var int */
        public int $MaxPaymentTime=0,

        /** @description If the booking should be either 1 = Booked) or 3 = Reserved. Default is 1 = Booked. */
        // @ApiMember(Description="If the booking should be either 1 = Booked) or 3 = Reserved. Default is 1 = Booked.")
        /** @var int */
        public int $BookingStatusId=0,

        /** @var bool|null */
        public ?bool $OnlyVisibleByAdmin=null,
        /** @var int|null */
        public ?int $LengthInMinutes=null,
        /** @var int */
        public int $DurationTypeId=0,
        /** @var int|null */
        public ?int $Duration=null,
        /** @var int|null */
        public ?int $MinDuration=null,
        /** @var int|null */
        public ?int $MaxDuration=null,
        /** @var int|null */
        public ?int $DurationInterval=null,
        /** @var int */
        public int $PauseAfterBooking=0,
        /** @var array<CustomFieldConfigData>|null */
        public ?array $CustomFields=null,
        /** @var array<CustomFieldDataResponse>|null */
        public ?array $CustomFieldValues=null,
        /** @var array<CustomFieldConfigData>|null */
        public ?array $BookingCustomFields=null,
        /** @var array<CustomFieldConfigData>|null */
        public ?array $CustomerCustomFields=null,
        /** @description The booking status options to choose from */
        // @ApiMember(Description="The booking status options to choose from")
        /** @var array<BookingStatusOptionsResponse>|null */
        public ?array $BookingStatusOptions=null,

        /** @var array<ServicePriceResponse>|null */
        public ?array $Prices=null,
        /** @var ServiceSchedules|null */
        public ?ServiceSchedules $Schedules=null,
        /** @var CompanyRatingSummary|null */
        public ?CompanyRatingSummary $RatingSummary=null,
        /** @var array<RatingReviewResponse>|null */
        public ?array $Reviews=null,
        /** @var array<ServiceResourceTypeResponse>|null */
        public ?array $ResourceTypes=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var int|null */
        public ?int $PriceViewTypeId=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ImageUrl'])) $this->ImageUrl = JsonConverters::from('string', $o['ImageUrl']);
        if (isset($o['TotalSpots'])) $this->TotalSpots = $o['TotalSpots'];
        if (isset($o['LockSpotsToBooking'])) $this->LockSpotsToBooking = $o['LockSpotsToBooking'];
        if (isset($o['MinNumberOfSpotsPerBooking'])) $this->MinNumberOfSpotsPerBooking = $o['MinNumberOfSpotsPerBooking'];
        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['UnbookBeforeDays'])) $this->UnbookBeforeDays = $o['UnbookBeforeDays'];
        if (isset($o['UnbookBeforeHours'])) $this->UnbookBeforeHours = $o['UnbookBeforeHours'];
        if (isset($o['UnbookBeforeMinutes'])) $this->UnbookBeforeMinutes = $o['UnbookBeforeMinutes'];
        if (isset($o['ScheduleType'])) $this->ScheduleType = JsonConverters::from('ScheduleType', $o['ScheduleType']);
        if (isset($o['ScheduleTypeId'])) $this->ScheduleTypeId = $o['ScheduleTypeId'];
        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['Group'])) $this->Group = $o['Group'];
        if (isset($o['EnableBookingQueue'])) $this->EnableBookingQueue = $o['EnableBookingQueue'];
        if (isset($o['EnableCodeLockSync'])) $this->EnableCodeLockSync = $o['EnableCodeLockSync'];
        if (isset($o['EnableCustomerManualPayment'])) $this->EnableCustomerManualPayment = $o['EnableCustomerManualPayment'];
        if (isset($o['SortOrder'])) $this->SortOrder = $o['SortOrder'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['IsGroupBooking'])) $this->IsGroupBooking = $o['IsGroupBooking'];
        if (isset($o['GroupBooking'])) $this->GroupBooking = JsonConverters::from('GroupBookingSettings', $o['GroupBooking']);
        if (isset($o['MultipleResource'])) $this->MultipleResource = JsonConverters::from('MultipleResourceSettings', $o['MultipleResource']);
        if (isset($o['IsPaymentEnabled'])) $this->IsPaymentEnabled = $o['IsPaymentEnabled'];
        if (isset($o['MaxPaymentTime'])) $this->MaxPaymentTime = $o['MaxPaymentTime'];
        if (isset($o['BookingStatusId'])) $this->BookingStatusId = $o['BookingStatusId'];
        if (isset($o['OnlyVisibleByAdmin'])) $this->OnlyVisibleByAdmin = $o['OnlyVisibleByAdmin'];
        if (isset($o['LengthInMinutes'])) $this->LengthInMinutes = $o['LengthInMinutes'];
        if (isset($o['DurationTypeId'])) $this->DurationTypeId = $o['DurationTypeId'];
        if (isset($o['Duration'])) $this->Duration = $o['Duration'];
        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['PauseAfterBooking'])) $this->PauseAfterBooking = $o['PauseAfterBooking'];
        if (isset($o['CustomFields'])) $this->CustomFields = JsonConverters::fromArray('CustomFieldConfigData', $o['CustomFields']);
        if (isset($o['CustomFieldValues'])) $this->CustomFieldValues = JsonConverters::fromArray('CustomFieldDataResponse', $o['CustomFieldValues']);
        if (isset($o['BookingCustomFields'])) $this->BookingCustomFields = JsonConverters::fromArray('CustomFieldConfigData', $o['BookingCustomFields']);
        if (isset($o['CustomerCustomFields'])) $this->CustomerCustomFields = JsonConverters::fromArray('CustomFieldConfigData', $o['CustomerCustomFields']);
        if (isset($o['BookingStatusOptions'])) $this->BookingStatusOptions = JsonConverters::fromArray('BookingStatusOptionsResponse', $o['BookingStatusOptions']);
        if (isset($o['Prices'])) $this->Prices = JsonConverters::fromArray('ServicePriceResponse', $o['Prices']);
        if (isset($o['Schedules'])) $this->Schedules = JsonConverters::from('ServiceSchedules', $o['Schedules']);
        if (isset($o['RatingSummary'])) $this->RatingSummary = JsonConverters::from('CompanyRatingSummary', $o['RatingSummary']);
        if (isset($o['Reviews'])) $this->Reviews = JsonConverters::fromArray('RatingReviewResponse', $o['Reviews']);
        if (isset($o['ResourceTypes'])) $this->ResourceTypes = JsonConverters::fromArray('ServiceResourceTypeResponse', $o['ResourceTypes']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['PriceViewTypeId'])) $this->PriceViewTypeId = $o['PriceViewTypeId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ImageUrl)) $o['ImageUrl'] = JsonConverters::to('string', $this->ImageUrl);
        if (isset($this->TotalSpots)) $o['TotalSpots'] = $this->TotalSpots;
        if (isset($this->LockSpotsToBooking)) $o['LockSpotsToBooking'] = $this->LockSpotsToBooking;
        if (isset($this->MinNumberOfSpotsPerBooking)) $o['MinNumberOfSpotsPerBooking'] = $this->MinNumberOfSpotsPerBooking;
        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->UnbookBeforeDays)) $o['UnbookBeforeDays'] = $this->UnbookBeforeDays;
        if (isset($this->UnbookBeforeHours)) $o['UnbookBeforeHours'] = $this->UnbookBeforeHours;
        if (isset($this->UnbookBeforeMinutes)) $o['UnbookBeforeMinutes'] = $this->UnbookBeforeMinutes;
        if (isset($this->ScheduleType)) $o['ScheduleType'] = JsonConverters::to('ScheduleType', $this->ScheduleType);
        if (isset($this->ScheduleTypeId)) $o['ScheduleTypeId'] = $this->ScheduleTypeId;
        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->Group)) $o['Group'] = $this->Group;
        if (isset($this->EnableBookingQueue)) $o['EnableBookingQueue'] = $this->EnableBookingQueue;
        if (isset($this->EnableCodeLockSync)) $o['EnableCodeLockSync'] = $this->EnableCodeLockSync;
        if (isset($this->EnableCustomerManualPayment)) $o['EnableCustomerManualPayment'] = $this->EnableCustomerManualPayment;
        if (isset($this->SortOrder)) $o['SortOrder'] = $this->SortOrder;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->IsGroupBooking)) $o['IsGroupBooking'] = $this->IsGroupBooking;
        if (isset($this->GroupBooking)) $o['GroupBooking'] = JsonConverters::to('GroupBookingSettings', $this->GroupBooking);
        if (isset($this->MultipleResource)) $o['MultipleResource'] = JsonConverters::to('MultipleResourceSettings', $this->MultipleResource);
        if (isset($this->IsPaymentEnabled)) $o['IsPaymentEnabled'] = $this->IsPaymentEnabled;
        if (isset($this->MaxPaymentTime)) $o['MaxPaymentTime'] = $this->MaxPaymentTime;
        if (isset($this->BookingStatusId)) $o['BookingStatusId'] = $this->BookingStatusId;
        if (isset($this->OnlyVisibleByAdmin)) $o['OnlyVisibleByAdmin'] = $this->OnlyVisibleByAdmin;
        if (isset($this->LengthInMinutes)) $o['LengthInMinutes'] = $this->LengthInMinutes;
        if (isset($this->DurationTypeId)) $o['DurationTypeId'] = $this->DurationTypeId;
        if (isset($this->Duration)) $o['Duration'] = $this->Duration;
        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->PauseAfterBooking)) $o['PauseAfterBooking'] = $this->PauseAfterBooking;
        if (isset($this->CustomFields)) $o['CustomFields'] = JsonConverters::toArray('CustomFieldConfigData', $this->CustomFields);
        if (isset($this->CustomFieldValues)) $o['CustomFieldValues'] = JsonConverters::toArray('CustomFieldDataResponse', $this->CustomFieldValues);
        if (isset($this->BookingCustomFields)) $o['BookingCustomFields'] = JsonConverters::toArray('CustomFieldConfigData', $this->BookingCustomFields);
        if (isset($this->CustomerCustomFields)) $o['CustomerCustomFields'] = JsonConverters::toArray('CustomFieldConfigData', $this->CustomerCustomFields);
        if (isset($this->BookingStatusOptions)) $o['BookingStatusOptions'] = JsonConverters::toArray('BookingStatusOptionsResponse', $this->BookingStatusOptions);
        if (isset($this->Prices)) $o['Prices'] = JsonConverters::toArray('ServicePriceResponse', $this->Prices);
        if (isset($this->Schedules)) $o['Schedules'] = JsonConverters::to('ServiceSchedules', $this->Schedules);
        if (isset($this->RatingSummary)) $o['RatingSummary'] = JsonConverters::to('CompanyRatingSummary', $this->RatingSummary);
        if (isset($this->Reviews)) $o['Reviews'] = JsonConverters::toArray('RatingReviewResponse', $this->Reviews);
        if (isset($this->ResourceTypes)) $o['ResourceTypes'] = JsonConverters::toArray('ServiceResourceTypeResponse', $this->ResourceTypes);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->PriceViewTypeId)) $o['PriceViewTypeId'] = $this->PriceViewTypeId;
        return empty($o) ? new class(){} : $o;
    }
}

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

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

        /** @description If the resources within the resourcetype should be selectable by customer when creating a booking */
        // @ApiMember(Description="If the resources within the resourcetype should be selectable by customer when creating a booking")
        /** @var bool|null */
        public ?bool $SelectableByUser=null
    ) {
    }

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

// @ValidateRequest(Validator="IsAuthenticated")
class AddResourceTypeToService implements JsonSerializable
{
    public function __construct(
        /** @description The company id */
        // @ApiMember(Description="The company id", IsRequired=true)
        /** @var string */
        public string $CompanyId='',

        /** @description The service id */
        // @ApiMember(Description="The service id", IsRequired=true, ParameterType="path")
        /** @var int */
        public int $Id=0,

        /** @description The ResourceType(s) to be added */
        // @ApiMember(Description="The ResourceType(s) to be added")
        /** @var array<AddResourceTypeService>|null */
        public ?array $ResourceTypes=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['ResourceTypes'])) $this->ResourceTypes = JsonConverters::fromArray('AddResourceTypeService', $o['ResourceTypes']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->ResourceTypes)) $o['ResourceTypes'] = JsonConverters::toArray('AddResourceTypeService', $this->ResourceTypes);
        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;
    }
}

/**
 * @template TCreatedCheckoutResponse
 * @template TCheckoutResponse
 * @template TPaymentResponse
 */
interface IBokameraPaymentManager3
{
}

class QvicklyArticle implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $artnr=null,
        /** @var string|null */
        public ?string $title=null,
        /** @var int */
        public int $quantity=0,
        /** @var int */
        public int $aprice=0,
        /** @var int */
        public int $tax=0,
        /** @var int */
        public int $discount=0,
        /** @var int */
        public int $withouttax=0,
        /** @var int */
        public int $taxrate=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['artnr'])) $this->artnr = $o['artnr'];
        if (isset($o['title'])) $this->title = $o['title'];
        if (isset($o['quantity'])) $this->quantity = $o['quantity'];
        if (isset($o['aprice'])) $this->aprice = $o['aprice'];
        if (isset($o['tax'])) $this->tax = $o['tax'];
        if (isset($o['discount'])) $this->discount = $o['discount'];
        if (isset($o['withouttax'])) $this->withouttax = $o['withouttax'];
        if (isset($o['taxrate'])) $this->taxrate = $o['taxrate'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->artnr)) $o['artnr'] = $this->artnr;
        if (isset($this->title)) $o['title'] = $this->title;
        if (isset($this->quantity)) $o['quantity'] = $this->quantity;
        if (isset($this->aprice)) $o['aprice'] = $this->aprice;
        if (isset($this->tax)) $o['tax'] = $this->tax;
        if (isset($this->discount)) $o['discount'] = $this->discount;
        if (isset($this->withouttax)) $o['withouttax'] = $this->withouttax;
        if (isset($this->taxrate)) $o['taxrate'] = $this->taxrate;
        return empty($o) ? new class(){} : $o;
    }
}

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 StripeEntity implements IStripeEntity, JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

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

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

/**
 * @template T
 * @template StripeEntity1 of StripeList<T>
 */
class StripeList extends StripeEntity1 implements IHasObject, JsonSerializable
{
    public array $genericArgs = [];
    public static function create(array $genericArgs=[]): StripeList {
        $to = new StripeList();
        $to->genericArgs = $genericArgs;
        return $to;
    }

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

/**
 * @template TCategoryName
 */
interface ILogger extends ILogger
{
}

PHP AddResourceTypeToService DTOs

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

HTTP + JSV

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

POST /services/{Id}/addresourcetype HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Id: 0,
	ResourceTypes: 
	[
		{
			CompanyId: 00000000-0000-0000-0000-000000000000,
			Id: 0,
			SelectableByUser: False
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Id: 0,
	Name: String,
	Description: String,
	TotalSpots: 0,
	LockSpotsToBooking: False,
	MinNumberOfSpotsPerBooking: 0,
	MaxNumberOfSpotsPerBooking: 0,
	MinNumberOfResourcesToBook: 0,
	MaxNumberOfResourcesToBook: 0,
	UnbookBeforeDays: 0,
	UnbookBeforeHours: 0,
	UnbookBeforeMinutes: 0,
	ScheduleType: NotDefined,
	ScheduleTypeId: 0,
	BookBeforeDays: 0,
	BookBeforeHours: 0,
	BookBeforeMinutes: 0,
	Group: String,
	EnableBookingQueue: False,
	EnableCodeLockSync: False,
	EnableCustomerManualPayment: False,
	SortOrder: 0,
	Active: False,
	IsGroupBooking: False,
	GroupBooking: 
	{
		Active: False,
		Min: 0,
		Max: 0
	},
	MultipleResource: 
	{
		Active: False,
		Min: 0,
		Max: 0
	},
	IsPaymentEnabled: False,
	MaxPaymentTime: 0,
	BookingStatusId: 0,
	OnlyVisibleByAdmin: False,
	LengthInMinutes: 0,
	DurationTypeId: 0,
	Duration: 0,
	MinDuration: 0,
	MaxDuration: 0,
	DurationInterval: 0,
	PauseAfterBooking: 0,
	CustomFields: 
	[
		{
			"Id": 0,
			"Name": "String",
			"Description": "String",
			"Width": 0,
			"DataType": "String",
			"DefaultValue": "String",
			"IsMandatory": false,
			"MandatoryErrorMessage": "String",
			"MaxLength": 0,
			"MultipleLineText": false,
			"RegEx": "String",
			"RegExErrorMessage": "String",
			"Values": 
			[
				{
					"Value": "String"
				}
			]
		}
	],
	CustomFieldValues: 
	[
		{
			Id: 0,
			Column: String,
			Name: String,
			Description: String,
			Value: String,
			DataType: String
		}
	],
	BookingCustomFields: 
	[
		{
			"Id": 0,
			"Name": "String",
			"Description": "String",
			"Width": 0,
			"DataType": "String",
			"DefaultValue": "String",
			"IsMandatory": false,
			"MandatoryErrorMessage": "String",
			"MaxLength": 0,
			"MultipleLineText": false,
			"RegEx": "String",
			"RegExErrorMessage": "String",
			"Values": 
			[
				{
					"Value": "String"
				}
			]
		}
	],
	CustomerCustomFields: 
	[
		{
			"Id": 0,
			"Name": "String",
			"Description": "String",
			"Width": 0,
			"DataType": "String",
			"DefaultValue": "String",
			"IsMandatory": false,
			"MandatoryErrorMessage": "String",
			"MaxLength": 0,
			"MultipleLineText": false,
			"RegEx": "String",
			"RegExErrorMessage": "String",
			"Values": 
			[
				{
					"Value": "String"
				}
			]
		}
	],
	BookingStatusOptions: 
	[
		{
			Id: 0,
			Name: String,
			Description: String
		}
	],
	Prices: 
	[
		{
			Id: 0,
			ServiceId: 0,
			Price: 0,
			CalculationTypeId: 0,
			CurrencyId: String,
			PriceSign: String,
			VAT: 0,
			Category: String,
			PriceText: String,
			DaysOfWeek: 
			[
				{
					DayOfWeekId: 0,
					DotNetDayOfWeekId: 0,
					DayOfWeek: String
				}
			],
			FromTime: PT0S,
			ToTime: PT0S,
			Service: 
			{
				Id: 0,
				Name: String,
				Description: String,
				LengthInMinutes: 0,
				MaxNumberOfSpotsPerBooking: 0,
				MinNumberOfSpotsPerBooking: 0,
				GroupBooking: 
				{
					Active: False,
					Min: 0,
					Max: 0
				},
				MultipleResource: 
				{
					Active: False,
					Min: 0,
					Max: 0
				},
				IsGroupBooking: False,
				IsPaymentEnabled: False
			},
			IsTimeSpecific: False,
			IsDaysOfWeekSpecific: False
		}
	],
	Schedules: 
	{
		ScheduleType: NotDefined,
		RecurringSchedules: 
		[
			{
				
			}
		],
		DateSchedules: 
		[
			{
				
			}
		]
	},
	RatingSummary: 
	{
		AverageScore: 0,
		RatingScore1Count: 0,
		RatingScore2Count: 0,
		RatingScore3Count: 0,
		RaingScore4Count: 0,
		RatingScore5Count: 0,
		Count: 0
	},
	Reviews: 
	[
		{
			Title: String,
			Description: String,
			RatingScore: 0,
			Author: String,
			ReviewAnswer: String
		}
	],
	ResourceTypes: 
	[
		{
			Id: 0,
			SelectableByUser: False,
			Name: String,
			Description: String,
			Resources: 
			[
				{
					Id: 0,
					Name: String,
					Description: String,
					Email: String,
					Phone: String,
					Color: String,
					Priority: 0,
					EmailNotification: False,
					SMSNotification: False,
					EmailReminder: False,
					SMSReminder: False
				}
			]
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	PriceViewTypeId: 0
}