Agentivity API

<back to all web services

BookingDetailsByRef

The following routes are available for this service:
GET/BookingDetails
<?php namespace dtos;

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


// @DataContract(Name="Metadata", Namespace="schemas.agentivity.com/types")
class PagingMetadata implements JsonSerializable
{
    public function __construct(
        /** @description Starting Record */
        // @DataMember
        // @ApiMember(DataType="string", Description="Starting Record", Name="Offset", ParameterType="query")
        /** @var string|null */
        public ?string $Offset=null,

        /** @description Number of records to return (PageSize) */
        // @DataMember
        // @ApiMember(DataType="string", Description="Number of records to return (PageSize)", Name="Limit", ParameterType="query")
        /** @var string|null */
        public ?string $Limit=null,

        /** @description Total Number of Records in a Full Reponse (if no paging) */
        // @DataMember
        // @ApiMember(DataType="string", Description="Total Number of Records in a Full Reponse (if no paging)", Name="TotalRecords", ParameterType="query")
        /** @var int */
        public int $TotalRecords=0,

        /** @description Total Number of Records in this Reponse (on this page) */
        // @DataMember
        // @ApiMember(DataType="string", Description="Total Number of Records in this Reponse (on this page)", Name="ResponseRecords", ParameterType="query")
        /** @var int */
        public int $ResponseRecords=0
    ) {
    }

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

// @DataContract(Namespace="schemas.agentivity.com/types")
class CompanyLevelRequestBase extends PagingMetadata implements IMemberUsername, IMemberOwningCompanyCode, JsonSerializable
{
    /**
     * @param string|null $Offset
     * @param string|null $Limit
     * @param int $TotalRecords
     * @param int $ResponseRecords
     */
    public function __construct(
        ?string $Offset=null,
        ?string $Limit=null,
        int $TotalRecords=0,
        int $ResponseRecords=0,
        /** @description Comma Delimited List of Owning Company Codes */
        // @DataMember
        /** @var string[]|null */
        public ?array $OwningCompanyCode=null,

        /** @description UserName in form of an email address */
        // @DataMember
        /** @var string|null */
        public ?string $UserName=null
    ) {
        parent::__construct($Offset,$Limit,$TotalRecords,$ResponseRecords);
    }

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

// @DataContract(Name="FrequentFlyer", Namespace="schemas.agentivity.com/types")
class FrequentFlyerDetails implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var string|null */
        public ?string $Vendor=null,

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

        // @DataMember(Order=30)
        /** @var string|null */
        public ?string $FullNumber=null
    ) {
    }

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

// @DataContract(Name="Passenger", Namespace="schemas.agentivity.com/types")
class PassengerDetails implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var int */
        public int $Id=0,

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

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

        // @DataMember(Order=40)
        /** @var array<FrequentFlyerDetails>|null */
        public ?array $FrequentFlyers=null,

        // @DataMember(Order=50)
        /** @var int */
        public int $SequenceNbr=0,

        // @DataMember(Order=60)
        /** @var int */
        public int $LastNameElement=0,

        // @DataMember(Order=70)
        /** @var bool|null */
        public ?bool $IsVip=null,

        // @DataMember(Order=80)
        /** @var string|null */
        public ?string $TravellerGUID=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['FrequentFlyers'])) $this->FrequentFlyers = JsonConverters::fromArray('FrequentFlyerDetails', $o['FrequentFlyers']);
        if (isset($o['SequenceNbr'])) $this->SequenceNbr = $o['SequenceNbr'];
        if (isset($o['LastNameElement'])) $this->LastNameElement = $o['LastNameElement'];
        if (isset($o['IsVip'])) $this->IsVip = $o['IsVip'];
        if (isset($o['TravellerGUID'])) $this->TravellerGUID = $o['TravellerGUID'];
    }
    
    /** @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->FrequentFlyers)) $o['FrequentFlyers'] = JsonConverters::toArray('FrequentFlyerDetails', $this->FrequentFlyers);
        if (isset($this->SequenceNbr)) $o['SequenceNbr'] = $this->SequenceNbr;
        if (isset($this->LastNameElement)) $o['LastNameElement'] = $this->LastNameElement;
        if (isset($this->IsVip)) $o['IsVip'] = $this->IsVip;
        if (isset($this->TravellerGUID)) $o['TravellerGUID'] = $this->TravellerGUID;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="Phone", Namespace="schemas.agentivity.com/types")
class BookingPhone implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var string|null */
        public ?string $PhoneType=null,

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

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

        // @DataMember(Order=40)
        /** @var int */
        public int $SequenceNbr=0
    ) {
    }

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

// @DataContract(Name="Notepad", Namespace="schemas.agentivity.com/types")
class BookingNotepad implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var string|null */
        public ?string $Remark=null,

        // @DataMember(Order=20)
        /** @var DateTime|null */
        public ?DateTime $CreatedDate=null,

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

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

        // @DataMember(Order=40)
        /** @var int */
        public int $SequenceNbr=0
    ) {
    }

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

// @DataContract(Namespace="schemas.agentivity.com/types")
class VendorRemarkBase implements JsonSerializable
{
    public function __construct(
        // @DataMember
        /** @var int|null */
        public ?int $TravelOrderIdentifier=null,

        // @DataMember
        /** @var int|null */
        public ?int $RmkNum=null,

        // @DataMember
        /** @var DateTime|null */
        public ?DateTime $DateStamp=null,

        // @DataMember
        /** @var string|null */
        public ?string $TimeStamp=null,

        // @DataMember
        /** @var string|null */
        public ?string $RemarkType=null,

        // @DataMember
        /** @var string|null */
        public ?string $VendorType=null,

        // @DataMember
        /** @var string|null */
        public ?string $Vendor=null,

        // @DataMember
        /** @var string|null */
        public ?string $Remark=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['TravelOrderIdentifier'])) $this->TravelOrderIdentifier = $o['TravelOrderIdentifier'];
        if (isset($o['RmkNum'])) $this->RmkNum = $o['RmkNum'];
        if (isset($o['DateStamp'])) $this->DateStamp = JsonConverters::from('DateTime', $o['DateStamp']);
        if (isset($o['TimeStamp'])) $this->TimeStamp = $o['TimeStamp'];
        if (isset($o['RemarkType'])) $this->RemarkType = $o['RemarkType'];
        if (isset($o['VendorType'])) $this->VendorType = $o['VendorType'];
        if (isset($o['Vendor'])) $this->Vendor = $o['Vendor'];
        if (isset($o['Remark'])) $this->Remark = $o['Remark'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->TravelOrderIdentifier)) $o['TravelOrderIdentifier'] = $this->TravelOrderIdentifier;
        if (isset($this->RmkNum)) $o['RmkNum'] = $this->RmkNum;
        if (isset($this->DateStamp)) $o['DateStamp'] = JsonConverters::to('DateTime', $this->DateStamp);
        if (isset($this->TimeStamp)) $o['TimeStamp'] = $this->TimeStamp;
        if (isset($this->RemarkType)) $o['RemarkType'] = $this->RemarkType;
        if (isset($this->VendorType)) $o['VendorType'] = $this->VendorType;
        if (isset($this->Vendor)) $o['Vendor'] = $this->Vendor;
        if (isset($this->Remark)) $o['Remark'] = $this->Remark;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Namespace="schemas.agentivity.com/types")
class VendorRemark extends VendorRemarkBase implements JsonSerializable
{
    /**
     * @param int|null $TravelOrderIdentifier
     * @param int|null $RmkNum
     * @param DateTime|null $DateStamp
     * @param string|null $TimeStamp
     * @param string|null $RemarkType
     * @param string|null $VendorType
     * @param string|null $Vendor
     * @param string|null $Remark
     */
    public function __construct(
        ?int $TravelOrderIdentifier=null,
        ?int $RmkNum=null,
        ?DateTime $DateStamp=null,
        ?string $TimeStamp=null,
        ?string $RemarkType=null,
        ?string $VendorType=null,
        ?string $Vendor=null,
        ?string $Remark=null,
        // @DataMember
        /** @var int */
        public int $VendorRemarkID=0
    ) {
        parent::__construct($TravelOrderIdentifier,$RmkNum,$DateStamp,$TimeStamp,$RemarkType,$VendorType,$Vendor,$Remark);
    }

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

// @DataContract(Name="DIEntry", Namespace="schemas.agentivity.com/types")
class DiEntry implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var int */
        public int $SequenceNbr=0,

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

        // @DataMember(Order=30)
        /** @var string|null */
        public ?string $Remark=null
    ) {
    }

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

// @DataContract(Name="Ticket", Namespace="schemas.agentivity.com/types")
class BookingTicket implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var int */
        public int $SegmentNbr=0,

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

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

        // @DataMember(Order=40)
        /** @var bool|null */
        public ?bool $TicketDetailsAvailable=null
    ) {
    }

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

// @DataContract(Name="Version", Namespace="schemas.agentivity.com/types")
class BookingVersion implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var int|null */
        public ?int $AgentivityRef=null,

        // @DataMember(Order=20)
        /** @var DateTime|null */
        public ?DateTime $DataBaseTimeStamp=null,

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

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

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

        // @DataMember(Order=60)
        /** @var int */
        public int $AirSegs=0,

        // @DataMember(Order=70)
        /** @var int */
        public int $AirPSegs=0,

        // @DataMember(Order=80)
        /** @var int */
        public int $HtlSegs=0,

        // @DataMember(Order=90)
        /** @var int */
        public int $HtlPSegs=0,

        // @DataMember(Order=100)
        /** @var int */
        public int $CarSegs=0,

        // @DataMember(Order=110)
        /** @var int */
        public int $CarPSegs=0,

        // @DataMember(Order=120)
        /** @var int */
        public int $TrnPSegs=0,

        // @DataMember(Order=130)
        /** @var string|null */
        public ?string $OwningAgencyLocationID=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AgentivityRef'])) $this->AgentivityRef = $o['AgentivityRef'];
        if (isset($o['DataBaseTimeStamp'])) $this->DataBaseTimeStamp = JsonConverters::from('DateTime', $o['DataBaseTimeStamp']);
        if (isset($o['EventType'])) $this->EventType = $o['EventType'];
        if (isset($o['PnrTicketed'])) $this->PnrTicketed = $o['PnrTicketed'];
        if (isset($o['LastActionAgentId'])) $this->LastActionAgentId = $o['LastActionAgentId'];
        if (isset($o['AirSegs'])) $this->AirSegs = $o['AirSegs'];
        if (isset($o['AirPSegs'])) $this->AirPSegs = $o['AirPSegs'];
        if (isset($o['HtlSegs'])) $this->HtlSegs = $o['HtlSegs'];
        if (isset($o['HtlPSegs'])) $this->HtlPSegs = $o['HtlPSegs'];
        if (isset($o['CarSegs'])) $this->CarSegs = $o['CarSegs'];
        if (isset($o['CarPSegs'])) $this->CarPSegs = $o['CarPSegs'];
        if (isset($o['TrnPSegs'])) $this->TrnPSegs = $o['TrnPSegs'];
        if (isset($o['OwningAgencyLocationID'])) $this->OwningAgencyLocationID = $o['OwningAgencyLocationID'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->AgentivityRef)) $o['AgentivityRef'] = $this->AgentivityRef;
        if (isset($this->DataBaseTimeStamp)) $o['DataBaseTimeStamp'] = JsonConverters::to('DateTime', $this->DataBaseTimeStamp);
        if (isset($this->EventType)) $o['EventType'] = $this->EventType;
        if (isset($this->PnrTicketed)) $o['PnrTicketed'] = $this->PnrTicketed;
        if (isset($this->LastActionAgentId)) $o['LastActionAgentId'] = $this->LastActionAgentId;
        if (isset($this->AirSegs)) $o['AirSegs'] = $this->AirSegs;
        if (isset($this->AirPSegs)) $o['AirPSegs'] = $this->AirPSegs;
        if (isset($this->HtlSegs)) $o['HtlSegs'] = $this->HtlSegs;
        if (isset($this->HtlPSegs)) $o['HtlPSegs'] = $this->HtlPSegs;
        if (isset($this->CarSegs)) $o['CarSegs'] = $this->CarSegs;
        if (isset($this->CarPSegs)) $o['CarPSegs'] = $this->CarPSegs;
        if (isset($this->TrnPSegs)) $o['TrnPSegs'] = $this->TrnPSegs;
        if (isset($this->OwningAgencyLocationID)) $o['OwningAgencyLocationID'] = $this->OwningAgencyLocationID;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="VendorLocator", Namespace="schemas.agentivity.com/types")
class BookingVendorLocator implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var int|null */
        public ?int $AirSegmentNbr=null,

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

        // @DataMember(Order=30)
        /** @var string|null */
        public ?string $VendorLocator=null
    ) {
    }

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

// @DataContract(Name="CustomFieldValue", Namespace="schemas.agentivity.com/types")
class CustomFieldValue implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var string|null */
        public ?string $PNRPropertiesCustomFieldID=null,

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

        // @DataMember(Order=30)
        /** @var DateTime */
        public DateTime $PNRCreationDate=new DateTime(),

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

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

        // @DataMember(Order=60)
        /** @var int|null */
        public ?int $CustomFieldID=null,

        // @DataMember(Order=70)
        /** @var DateTime|null */
        public ?DateTime $CreationDateTime=null,

        // @DataMember(Order=80)
        /** @var int|null */
        public ?int $ElementNumber=null,

        // @DataMember(Order=90)
        /** @var string|null */
        public ?string $GDS=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['PNRPropertiesCustomFieldID'])) $this->PNRPropertiesCustomFieldID = $o['PNRPropertiesCustomFieldID'];
        if (isset($o['RecordLocator'])) $this->RecordLocator = $o['RecordLocator'];
        if (isset($o['PNRCreationDate'])) $this->PNRCreationDate = JsonConverters::from('DateTime', $o['PNRCreationDate']);
        if (isset($o['FieldName'])) $this->FieldName = $o['FieldName'];
        if (isset($o['FieldValue'])) $this->FieldValue = $o['FieldValue'];
        if (isset($o['CustomFieldID'])) $this->CustomFieldID = $o['CustomFieldID'];
        if (isset($o['CreationDateTime'])) $this->CreationDateTime = JsonConverters::from('DateTime', $o['CreationDateTime']);
        if (isset($o['ElementNumber'])) $this->ElementNumber = $o['ElementNumber'];
        if (isset($o['GDS'])) $this->GDS = $o['GDS'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->PNRPropertiesCustomFieldID)) $o['PNRPropertiesCustomFieldID'] = $this->PNRPropertiesCustomFieldID;
        if (isset($this->RecordLocator)) $o['RecordLocator'] = $this->RecordLocator;
        if (isset($this->PNRCreationDate)) $o['PNRCreationDate'] = JsonConverters::to('DateTime', $this->PNRCreationDate);
        if (isset($this->FieldName)) $o['FieldName'] = $this->FieldName;
        if (isset($this->FieldValue)) $o['FieldValue'] = $this->FieldValue;
        if (isset($this->CustomFieldID)) $o['CustomFieldID'] = $this->CustomFieldID;
        if (isset($this->CreationDateTime)) $o['CreationDateTime'] = JsonConverters::to('DateTime', $this->CreationDateTime);
        if (isset($this->ElementNumber)) $o['ElementNumber'] = $this->ElementNumber;
        if (isset($this->GDS)) $o['GDS'] = $this->GDS;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="Email", Namespace="schemas.agentivity.com/types")
class BookingEmail implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var int */
        public int $SequenceNbr=0,

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

        // @DataMember(Order=30)
        /** @var string|null */
        public ?string $Email=null
    ) {
    }

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

// @DataContract(Name="EventDetail", Namespace="schemas.agentivity.com/types")
class BookingEventDetail implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var int */
        public int $ItineraryEventTypeDetailID=0,

        // @DataMember(Order=20)
        /** @var int */
        public int $AgentivityRef=0,

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

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

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

        // @DataMember(Order=60)
        /** @var DateTime|null */
        public ?DateTime $DateTimeStamp=null,

        // @DataMember(Order=70)
        /** @var int|null */
        public ?int $EventTypeDetailID=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ItineraryEventTypeDetailID'])) $this->ItineraryEventTypeDetailID = $o['ItineraryEventTypeDetailID'];
        if (isset($o['AgentivityRef'])) $this->AgentivityRef = $o['AgentivityRef'];
        if (isset($o['EventTypeDetail'])) $this->EventTypeDetail = $o['EventTypeDetail'];
        if (isset($o['OldData'])) $this->OldData = $o['OldData'];
        if (isset($o['NewData'])) $this->NewData = $o['NewData'];
        if (isset($o['DateTimeStamp'])) $this->DateTimeStamp = JsonConverters::from('DateTime', $o['DateTimeStamp']);
        if (isset($o['EventTypeDetailID'])) $this->EventTypeDetailID = $o['EventTypeDetailID'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ItineraryEventTypeDetailID)) $o['ItineraryEventTypeDetailID'] = $this->ItineraryEventTypeDetailID;
        if (isset($this->AgentivityRef)) $o['AgentivityRef'] = $this->AgentivityRef;
        if (isset($this->EventTypeDetail)) $o['EventTypeDetail'] = $this->EventTypeDetail;
        if (isset($this->OldData)) $o['OldData'] = $this->OldData;
        if (isset($this->NewData)) $o['NewData'] = $this->NewData;
        if (isset($this->DateTimeStamp)) $o['DateTimeStamp'] = JsonConverters::to('DateTime', $this->DateTimeStamp);
        if (isset($this->EventTypeDetailID)) $o['EventTypeDetailID'] = $this->EventTypeDetailID;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="AccountLocation", Namespace="schemas.agentivity.com/types")
class BookingAccountLocation implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var string|null */
        public ?string $PrimaryAccountLocation=null,

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

        // @DataMember(Order=30)
        /** @var bool|null */
        public ?bool $Valid=null,

        // @DataMember(Order=40)
        /** @var bool|null */
        public ?bool $ExactMatch=null,

        // @DataMember(Order=50)
        /** @var string|null */
        public ?string $GDS=null
    ) {
    }

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

// @DataContract(Name="BookingEmailTrail", Namespace="schemas.agentivity.com/types")
class BookingEmailTrail implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var string|null */
        public ?string $RecipientEmail=null,

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

        // @DataMember(Order=30)
        /** @var DateTime|null */
        public ?DateTime $MailSentDateTime=null,

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

        // @DataMember(Order=50)
        /** @var int|null */
        public ?int $EmailId=null,

        // @DataMember(Order=60)
        /** @var int|null */
        public ?int $UserId=null,

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

        // @DataMember(Order=80)
        /** @var int|null */
        public ?int $SentResponseErrorCode=null,

        // @DataMember(Order=90)
        /** @var int */
        public int $DeliveredBookingID=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['RecipientEmail'])) $this->RecipientEmail = $o['RecipientEmail'];
        if (isset($o['DeliveryDetails'])) $this->DeliveryDetails = $o['DeliveryDetails'];
        if (isset($o['MailSentDateTime'])) $this->MailSentDateTime = JsonConverters::from('DateTime', $o['MailSentDateTime']);
        if (isset($o['RecipientLastActivityEvent'])) $this->RecipientLastActivityEvent = $o['RecipientLastActivityEvent'];
        if (isset($o['EmailId'])) $this->EmailId = $o['EmailId'];
        if (isset($o['UserId'])) $this->UserId = $o['UserId'];
        if (isset($o['SentResponseMessage'])) $this->SentResponseMessage = $o['SentResponseMessage'];
        if (isset($o['SentResponseErrorCode'])) $this->SentResponseErrorCode = $o['SentResponseErrorCode'];
        if (isset($o['DeliveredBookingID'])) $this->DeliveredBookingID = $o['DeliveredBookingID'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->RecipientEmail)) $o['RecipientEmail'] = $this->RecipientEmail;
        if (isset($this->DeliveryDetails)) $o['DeliveryDetails'] = $this->DeliveryDetails;
        if (isset($this->MailSentDateTime)) $o['MailSentDateTime'] = JsonConverters::to('DateTime', $this->MailSentDateTime);
        if (isset($this->RecipientLastActivityEvent)) $o['RecipientLastActivityEvent'] = $this->RecipientLastActivityEvent;
        if (isset($this->EmailId)) $o['EmailId'] = $this->EmailId;
        if (isset($this->UserId)) $o['UserId'] = $this->UserId;
        if (isset($this->SentResponseMessage)) $o['SentResponseMessage'] = $this->SentResponseMessage;
        if (isset($this->SentResponseErrorCode)) $o['SentResponseErrorCode'] = $this->SentResponseErrorCode;
        if (isset($this->DeliveredBookingID)) $o['DeliveredBookingID'] = $this->DeliveredBookingID;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="Property", Namespace="schemas.agentivity.com/types")
class BookingWarningProperty implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var string|null */
        public ?string $Name=null,

        // @DataMember(Order=20)
        /** @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;
    }
}

// @DataContract(Name="Warning", Namespace="schemas.agentivity.com/types")
class BookingDetailsWarning implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var string|null */
        public ?string $Message=null,

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

        // @DataMember(Order=30)
        /** @var DateTime|null */
        public ?DateTime $WarningDateTime=null,

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

        // @DataMember(Order=50)
        /** @var DateTime|null */
        public ?DateTime $ClearedDateTime=null,

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

        // @DataMember(Order=70)
        /** @var array<BookingWarningProperty>|null */
        public ?array $PropertiesList=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Message'])) $this->Message = $o['Message'];
        if (isset($o['Vendor'])) $this->Vendor = $o['Vendor'];
        if (isset($o['WarningDateTime'])) $this->WarningDateTime = JsonConverters::from('DateTime', $o['WarningDateTime']);
        if (isset($o['OriginalRemark'])) $this->OriginalRemark = $o['OriginalRemark'];
        if (isset($o['ClearedDateTime'])) $this->ClearedDateTime = JsonConverters::from('DateTime', $o['ClearedDateTime']);
        if (isset($o['ClearedByConsultantID'])) $this->ClearedByConsultantID = $o['ClearedByConsultantID'];
        if (isset($o['PropertiesList'])) $this->PropertiesList = JsonConverters::fromArray('BookingWarningProperty', $o['PropertiesList']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Message)) $o['Message'] = $this->Message;
        if (isset($this->Vendor)) $o['Vendor'] = $this->Vendor;
        if (isset($this->WarningDateTime)) $o['WarningDateTime'] = JsonConverters::to('DateTime', $this->WarningDateTime);
        if (isset($this->OriginalRemark)) $o['OriginalRemark'] = $this->OriginalRemark;
        if (isset($this->ClearedDateTime)) $o['ClearedDateTime'] = JsonConverters::to('DateTime', $this->ClearedDateTime);
        if (isset($this->ClearedByConsultantID)) $o['ClearedByConsultantID'] = $this->ClearedByConsultantID;
        if (isset($this->PropertiesList)) $o['PropertiesList'] = JsonConverters::toArray('BookingWarningProperty', $this->PropertiesList);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="TicketingDue", Namespace="schemas.agentivity.com/types")
class BookingDetailsAirTicketingDue implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var string|null */
        public ?string $Airline=null,

        // @DataMember(Order=20)
        /** @var DateTime|null */
        public ?DateTime $DueDate=null,

        // @DataMember(Order=30)
        /** @var string|null */
        public ?string $DueTime=null
    ) {
    }

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

// @DataContract(Name="MeasurementUnit", Namespace="schemas.agentivity.com/types")
class MeasurementUnit implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var int */
        public int $Id=0,

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

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

// @DataContract(Name="AssessmentProvider", Namespace="schemas.agentivity.com/types")
class AssessmentProvider implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var int */
        public int $Id=0,

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

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

        // @DataMember(Order=40)
        /** @var string|null */
        public ?string $LogoPath=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['LogoPath'])) $this->LogoPath = $o['LogoPath'];
    }
    
    /** @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->LogoPath)) $o['LogoPath'] = $this->LogoPath;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="CarbonCalculationDetails", Namespace="schemas.agentivity.com/types")
class CarbonCalculationDetails implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var int */
        public int $Id=0,

        // @DataMember(Order=20)
        /** @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;
    }
}

// @DataContract(Name="CarbonEmission", Namespace="schemas.agentivity.com/types")
class CarbonEmission implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var float|null */
        public ?float $Value=null,

        // @DataMember(Order=20)
        /** @var MeasurementUnit|null */
        public ?MeasurementUnit $Unit=null,

        // @DataMember(Order=30)
        /** @var AssessmentProvider|null */
        public ?AssessmentProvider $Provider=null,

        // @DataMember(Order=40)
        /** @var DateTime|null */
        public ?DateTime $CalculationDateTime=null,

        // @DataMember(Order=50)
        /** @var CarbonCalculationDetails|null */
        public ?CarbonCalculationDetails $CalculationDetails=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Value'])) $this->Value = $o['Value'];
        if (isset($o['Unit'])) $this->Unit = JsonConverters::from('MeasurementUnit', $o['Unit']);
        if (isset($o['Provider'])) $this->Provider = JsonConverters::from('AssessmentProvider', $o['Provider']);
        if (isset($o['CalculationDateTime'])) $this->CalculationDateTime = JsonConverters::from('DateTime', $o['CalculationDateTime']);
        if (isset($o['CalculationDetails'])) $this->CalculationDetails = JsonConverters::from('CarbonCalculationDetails', $o['CalculationDetails']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Value)) $o['Value'] = $this->Value;
        if (isset($this->Unit)) $o['Unit'] = JsonConverters::to('MeasurementUnit', $this->Unit);
        if (isset($this->Provider)) $o['Provider'] = JsonConverters::to('AssessmentProvider', $this->Provider);
        if (isset($this->CalculationDateTime)) $o['CalculationDateTime'] = JsonConverters::to('DateTime', $this->CalculationDateTime);
        if (isset($this->CalculationDetails)) $o['CalculationDetails'] = JsonConverters::to('CarbonCalculationDetails', $this->CalculationDetails);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="ItinerarySegment", Namespace="schemas.agentivity.com/types")
class ItinerarySegment implements JsonSerializable
{
    public function __construct(
        // @DataMember
        /** @var string|null */
        public ?string $SegmentType=null,

        // @DataMember
        /** @var int */
        public int $SegmentNbr=0,

        // @DataMember
        /** @var string|null */
        public ?string $BoardPoint=null,

        // @DataMember
        /** @var string|null */
        public ?string $OffPoint=null,

        // @DataMember
        /** @var string|null */
        public ?string $OperatorCode=null,

        // @DataMember
        /** @var string|null */
        public ?string $OperatorService=null,

        // @DataMember
        /** @var string|null */
        public ?string $SegmentStatus=null,

        // @DataMember
        /** @var string|null */
        public ?string $DepartureTimeFormatted=null,

        // @DataMember
        /** @var string|null */
        public ?string $ArrivalTimeFormatted=null,

        // @DataMember
        /** @var string|null */
        public ?string $ChangeOfDayFormatted=null,

        // @DataMember
        /** @var string|null */
        public ?string $ServiceCode=null,

        // @DataMember
        /** @var string|null */
        public ?string $StartDate=null,

        // @DataMember
        /** @var string|null */
        public ?string $EndDate=null,

        // @DataMember
        /** @var string|null */
        public ?string $TicketNumber=null,

        /** @description Comma separated list of vendor locators */
        // @DataMember
        /** @var string|null */
        public ?string $VendorLocators=null,

        // @DataMember
        /** @var string|null */
        public ?string $EquipmentCode=null,

        // @DataMember
        /** @var string|null */
        public ?string $Equipment=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['SegmentType'])) $this->SegmentType = $o['SegmentType'];
        if (isset($o['SegmentNbr'])) $this->SegmentNbr = $o['SegmentNbr'];
        if (isset($o['BoardPoint'])) $this->BoardPoint = $o['BoardPoint'];
        if (isset($o['OffPoint'])) $this->OffPoint = $o['OffPoint'];
        if (isset($o['OperatorCode'])) $this->OperatorCode = $o['OperatorCode'];
        if (isset($o['OperatorService'])) $this->OperatorService = $o['OperatorService'];
        if (isset($o['SegmentStatus'])) $this->SegmentStatus = $o['SegmentStatus'];
        if (isset($o['DepartureTimeFormatted'])) $this->DepartureTimeFormatted = $o['DepartureTimeFormatted'];
        if (isset($o['ArrivalTimeFormatted'])) $this->ArrivalTimeFormatted = $o['ArrivalTimeFormatted'];
        if (isset($o['ChangeOfDayFormatted'])) $this->ChangeOfDayFormatted = $o['ChangeOfDayFormatted'];
        if (isset($o['ServiceCode'])) $this->ServiceCode = $o['ServiceCode'];
        if (isset($o['StartDate'])) $this->StartDate = $o['StartDate'];
        if (isset($o['EndDate'])) $this->EndDate = $o['EndDate'];
        if (isset($o['TicketNumber'])) $this->TicketNumber = $o['TicketNumber'];
        if (isset($o['VendorLocators'])) $this->VendorLocators = $o['VendorLocators'];
        if (isset($o['EquipmentCode'])) $this->EquipmentCode = $o['EquipmentCode'];
        if (isset($o['Equipment'])) $this->Equipment = $o['Equipment'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->SegmentType)) $o['SegmentType'] = $this->SegmentType;
        if (isset($this->SegmentNbr)) $o['SegmentNbr'] = $this->SegmentNbr;
        if (isset($this->BoardPoint)) $o['BoardPoint'] = $this->BoardPoint;
        if (isset($this->OffPoint)) $o['OffPoint'] = $this->OffPoint;
        if (isset($this->OperatorCode)) $o['OperatorCode'] = $this->OperatorCode;
        if (isset($this->OperatorService)) $o['OperatorService'] = $this->OperatorService;
        if (isset($this->SegmentStatus)) $o['SegmentStatus'] = $this->SegmentStatus;
        if (isset($this->DepartureTimeFormatted)) $o['DepartureTimeFormatted'] = $this->DepartureTimeFormatted;
        if (isset($this->ArrivalTimeFormatted)) $o['ArrivalTimeFormatted'] = $this->ArrivalTimeFormatted;
        if (isset($this->ChangeOfDayFormatted)) $o['ChangeOfDayFormatted'] = $this->ChangeOfDayFormatted;
        if (isset($this->ServiceCode)) $o['ServiceCode'] = $this->ServiceCode;
        if (isset($this->StartDate)) $o['StartDate'] = $this->StartDate;
        if (isset($this->EndDate)) $o['EndDate'] = $this->EndDate;
        if (isset($this->TicketNumber)) $o['TicketNumber'] = $this->TicketNumber;
        if (isset($this->VendorLocators)) $o['VendorLocators'] = $this->VendorLocators;
        if (isset($this->EquipmentCode)) $o['EquipmentCode'] = $this->EquipmentCode;
        if (isset($this->Equipment)) $o['Equipment'] = $this->Equipment;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template array of ItinerarySegment
 */
class ItinerarySegmentsCollection extends \ArrayObject implements JsonSerializable
{
    public function __construct(ItinerarySegment ...$items) {
        parent::__construct($items, \ArrayObject::STD_PROP_LIST);
    }
    
    /** @throws \Exception */
    public function append($value): void {
        if ($value instanceof ItinerarySegment)
            parent::append($value);
        else
            throw new \Exception("Can only append a ItinerarySegment to " . __CLASS__);
    }
    
    /** @throws Exception */
    public function fromMap($o): void {
        foreach ($o as $item) {
            $el = new ItinerarySegment();
            $el->fromMap($item);
            $this->append($el);
        }
    }
    
    /** @throws Exception */
    public function jsonSerialize(): array {
        return parent::getArrayCopy();
    }
}

// @DataContract(Name="BookingDetails", Namespace="schemas.agentivity.com/types")
class BookingDetails implements IBookingItinerary, JsonSerializable
{
    public function __construct(
        // @DataMember(Order=20)
        /** @var string|null */
        public ?string $RecordLocator=null,

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

        // @DataMember(Order=35)
        /** @var DateTime|null */
        public ?DateTime $CreationDate=null,

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

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

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

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

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

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

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

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

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

        // @DataMember(Order=130)
        /** @var int|null */
        public ?int $CompanyID=null,

        // @DataMember(Order=200)
        /** @var array<PassengerDetails>|null */
        public ?array $Passengers=null,

        // @DataMember(Order=210)
        /** @var array<BookingPhone>|null */
        public ?array $Phones=null,

        // @DataMember(Order=220)
        /** @var array<BookingNotepad>|null */
        public ?array $Notepads=null,

        // @DataMember(Order=230)
        /** @var array<VendorRemark>|null */
        public ?array $VendorRemarks=null,

        // @DataMember(Order=240)
        /** @var array<DiEntry>|null */
        public ?array $DiEntries=null,

        // @DataMember(Order=250)
        /** @var array<BookingTicket>|null */
        public ?array $Tickets=null,

        // @DataMember(Order=260)
        /** @var array<BookingVersion>|null */
        public ?array $Versions=null,

        // @DataMember(Order=270)
        /** @var array<BookingVendorLocator>|null */
        public ?array $VendorLocators=null,

        // @DataMember(Order=280)
        /** @var array<CustomFieldValue>|null */
        public ?array $CustomFields=null,

        // @DataMember(Order=290)
        /** @var array<BookingEmail>|null */
        public ?array $Emails=null,

        // @DataMember(Order=300)
        /** @var array<BookingEventDetail>|null */
        public ?array $EventDetails=null,

        // @DataMember(Order=310)
        /** @var array<BookingAccountLocation>|null */
        public ?array $AccountLocations=null,

        // @DataMember(Order=320)
        /** @var array<BookingEmailTrail>|null */
        public ?array $EmailTrails=null,

        // @DataMember(Order=330)
        /** @var array<BookingDetailsWarning>|null */
        public ?array $AgentivityWarnings=null,

        // @DataMember(Order=340)
        /** @var array<BookingDetailsAirTicketingDue>|null */
        public ?array $AirlineTicketingDues=null,

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

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

        // @DataMember(Order=370)
        /** @var float|null */
        public ?float $CarbonTonnage=null,

        // @DataMember(Order=380)
        /** @var array<CarbonEmission>|null */
        public ?array $CarbonEmissions=null,

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

        // @DataMember(Order=10)
        /** @var int */
        public int $AgentivityRef=0,

        // @DataMember(Order=1000)
        /** @var ItinerarySegmentsCollection|null */
        public ?ItinerarySegmentsCollection $Itinerary=null,

        // @DataMember(Order=1010)
        /** @var string|null */
        public ?string $ItineraryFormatted=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['RecordLocator'])) $this->RecordLocator = $o['RecordLocator'];
        if (isset($o['PNRCreationDate'])) $this->PNRCreationDate = $o['PNRCreationDate'];
        if (isset($o['CreationDate'])) $this->CreationDate = JsonConverters::from('DateTime', $o['CreationDate']);
        if (isset($o['PNRTicketed'])) $this->PNRTicketed = $o['PNRTicketed'];
        if (isset($o['Account'])) $this->Account = $o['Account'];
        if (isset($o['OwningConsultantID'])) $this->OwningConsultantID = $o['OwningConsultantID'];
        if (isset($o['OwningConsultant'])) $this->OwningConsultant = $o['OwningConsultant'];
        if (isset($o['CrsDescription'])) $this->CrsDescription = $o['CrsDescription'];
        if (isset($o['LastActionConsultantID'])) $this->LastActionConsultantID = $o['LastActionConsultantID'];
        if (isset($o['LastActionAgencyLocationID'])) $this->LastActionAgencyLocationID = $o['LastActionAgencyLocationID'];
        if (isset($o['OwningAgencyLocationID'])) $this->OwningAgencyLocationID = $o['OwningAgencyLocationID'];
        if (isset($o['CreatingAgencyIata'])) $this->CreatingAgencyIata = $o['CreatingAgencyIata'];
        if (isset($o['CompanyID'])) $this->CompanyID = $o['CompanyID'];
        if (isset($o['Passengers'])) $this->Passengers = JsonConverters::fromArray('PassengerDetails', $o['Passengers']);
        if (isset($o['Phones'])) $this->Phones = JsonConverters::fromArray('BookingPhone', $o['Phones']);
        if (isset($o['Notepads'])) $this->Notepads = JsonConverters::fromArray('BookingNotepad', $o['Notepads']);
        if (isset($o['VendorRemarks'])) $this->VendorRemarks = JsonConverters::fromArray('VendorRemark', $o['VendorRemarks']);
        if (isset($o['DiEntries'])) $this->DiEntries = JsonConverters::fromArray('DiEntry', $o['DiEntries']);
        if (isset($o['Tickets'])) $this->Tickets = JsonConverters::fromArray('BookingTicket', $o['Tickets']);
        if (isset($o['Versions'])) $this->Versions = JsonConverters::fromArray('BookingVersion', $o['Versions']);
        if (isset($o['VendorLocators'])) $this->VendorLocators = JsonConverters::fromArray('BookingVendorLocator', $o['VendorLocators']);
        if (isset($o['CustomFields'])) $this->CustomFields = JsonConverters::fromArray('CustomFieldValue', $o['CustomFields']);
        if (isset($o['Emails'])) $this->Emails = JsonConverters::fromArray('BookingEmail', $o['Emails']);
        if (isset($o['EventDetails'])) $this->EventDetails = JsonConverters::fromArray('BookingEventDetail', $o['EventDetails']);
        if (isset($o['AccountLocations'])) $this->AccountLocations = JsonConverters::fromArray('BookingAccountLocation', $o['AccountLocations']);
        if (isset($o['EmailTrails'])) $this->EmailTrails = JsonConverters::fromArray('BookingEmailTrail', $o['EmailTrails']);
        if (isset($o['AgentivityWarnings'])) $this->AgentivityWarnings = JsonConverters::fromArray('BookingDetailsWarning', $o['AgentivityWarnings']);
        if (isset($o['AirlineTicketingDues'])) $this->AirlineTicketingDues = JsonConverters::fromArray('BookingDetailsAirTicketingDue', $o['AirlineTicketingDues']);
        if (isset($o['CTCE'])) $this->CTCE = $o['CTCE'];
        if (isset($o['CTCM'])) $this->CTCM = $o['CTCM'];
        if (isset($o['CarbonTonnage'])) $this->CarbonTonnage = $o['CarbonTonnage'];
        if (isset($o['CarbonEmissions'])) $this->CarbonEmissions = JsonConverters::fromArray('CarbonEmission', $o['CarbonEmissions']);
        if (isset($o['OwningCompanyCode'])) $this->OwningCompanyCode = $o['OwningCompanyCode'];
        if (isset($o['AgentivityRef'])) $this->AgentivityRef = $o['AgentivityRef'];
        if (isset($o['Itinerary'])) $this->Itinerary = JsonConverters::from('ItinerarySegmentsCollection', $o['Itinerary']);
        if (isset($o['ItineraryFormatted'])) $this->ItineraryFormatted = $o['ItineraryFormatted'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->RecordLocator)) $o['RecordLocator'] = $this->RecordLocator;
        if (isset($this->PNRCreationDate)) $o['PNRCreationDate'] = $this->PNRCreationDate;
        if (isset($this->CreationDate)) $o['CreationDate'] = JsonConverters::to('DateTime', $this->CreationDate);
        if (isset($this->PNRTicketed)) $o['PNRTicketed'] = $this->PNRTicketed;
        if (isset($this->Account)) $o['Account'] = $this->Account;
        if (isset($this->OwningConsultantID)) $o['OwningConsultantID'] = $this->OwningConsultantID;
        if (isset($this->OwningConsultant)) $o['OwningConsultant'] = $this->OwningConsultant;
        if (isset($this->CrsDescription)) $o['CrsDescription'] = $this->CrsDescription;
        if (isset($this->LastActionConsultantID)) $o['LastActionConsultantID'] = $this->LastActionConsultantID;
        if (isset($this->LastActionAgencyLocationID)) $o['LastActionAgencyLocationID'] = $this->LastActionAgencyLocationID;
        if (isset($this->OwningAgencyLocationID)) $o['OwningAgencyLocationID'] = $this->OwningAgencyLocationID;
        if (isset($this->CreatingAgencyIata)) $o['CreatingAgencyIata'] = $this->CreatingAgencyIata;
        if (isset($this->CompanyID)) $o['CompanyID'] = $this->CompanyID;
        if (isset($this->Passengers)) $o['Passengers'] = JsonConverters::toArray('PassengerDetails', $this->Passengers);
        if (isset($this->Phones)) $o['Phones'] = JsonConverters::toArray('BookingPhone', $this->Phones);
        if (isset($this->Notepads)) $o['Notepads'] = JsonConverters::toArray('BookingNotepad', $this->Notepads);
        if (isset($this->VendorRemarks)) $o['VendorRemarks'] = JsonConverters::toArray('VendorRemark', $this->VendorRemarks);
        if (isset($this->DiEntries)) $o['DiEntries'] = JsonConverters::toArray('DiEntry', $this->DiEntries);
        if (isset($this->Tickets)) $o['Tickets'] = JsonConverters::toArray('BookingTicket', $this->Tickets);
        if (isset($this->Versions)) $o['Versions'] = JsonConverters::toArray('BookingVersion', $this->Versions);
        if (isset($this->VendorLocators)) $o['VendorLocators'] = JsonConverters::toArray('BookingVendorLocator', $this->VendorLocators);
        if (isset($this->CustomFields)) $o['CustomFields'] = JsonConverters::toArray('CustomFieldValue', $this->CustomFields);
        if (isset($this->Emails)) $o['Emails'] = JsonConverters::toArray('BookingEmail', $this->Emails);
        if (isset($this->EventDetails)) $o['EventDetails'] = JsonConverters::toArray('BookingEventDetail', $this->EventDetails);
        if (isset($this->AccountLocations)) $o['AccountLocations'] = JsonConverters::toArray('BookingAccountLocation', $this->AccountLocations);
        if (isset($this->EmailTrails)) $o['EmailTrails'] = JsonConverters::toArray('BookingEmailTrail', $this->EmailTrails);
        if (isset($this->AgentivityWarnings)) $o['AgentivityWarnings'] = JsonConverters::toArray('BookingDetailsWarning', $this->AgentivityWarnings);
        if (isset($this->AirlineTicketingDues)) $o['AirlineTicketingDues'] = JsonConverters::toArray('BookingDetailsAirTicketingDue', $this->AirlineTicketingDues);
        if (isset($this->CTCE)) $o['CTCE'] = $this->CTCE;
        if (isset($this->CTCM)) $o['CTCM'] = $this->CTCM;
        if (isset($this->CarbonTonnage)) $o['CarbonTonnage'] = $this->CarbonTonnage;
        if (isset($this->CarbonEmissions)) $o['CarbonEmissions'] = JsonConverters::toArray('CarbonEmission', $this->CarbonEmissions);
        if (isset($this->OwningCompanyCode)) $o['OwningCompanyCode'] = $this->OwningCompanyCode;
        if (isset($this->AgentivityRef)) $o['AgentivityRef'] = $this->AgentivityRef;
        if (isset($this->Itinerary)) $o['Itinerary'] = JsonConverters::to('ItinerarySegmentsCollection', $this->Itinerary);
        if (isset($this->ItineraryFormatted)) $o['ItineraryFormatted'] = $this->ItineraryFormatted;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="CacheMetadata", Namespace="schemas.agentivity.com/types")
class CacheMetadata implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=1)
        /** @var DateTime */
        public DateTime $CachedAt=new DateTime(),

        // @DataMember(Order=2)
        /** @var DateTime */
        public DateTime $CacheExpiresAt=new DateTime(),

        // @DataMember(Order=0)
        /** @var bool|null */
        public ?bool $IsFromCache=null
    ) {
    }

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

// @DataContract(Name="ResponseMetadata", Namespace="schemas.agentivity.com/types")
class ResponseMetadata implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=0)
        /** @var bool|null */
        public ?bool $Success=null,

        // @DataMember(Order=1)
        /** @var bool|null */
        public ?bool $HasCache=null,

        // @DataMember(Order=2)
        /** @var bool|null */
        public ?bool $HasPaging=null,

        // @DataMember(Order=3, EmitDefaultValue=false)
        /** @var CacheMetadata|null */
        public ?CacheMetadata $CacheMetadata=null,

        // @DataMember(Order=4, EmitDefaultValue=false)
        /** @var PagingMetadata|null */
        public ?PagingMetadata $PagingMetadata=null
    ) {
    }

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

// @DataContract(Name="ApiRequestPerHour", Namespace="schemas.agentivity.com/types")
class ApiRequestPerHour implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var DateTime */
        public DateTime $RequestDate=new DateTime(),

        // @DataMember(Order=100)
        /** @var int */
        public int $Hour0=0,

        // @DataMember(Order=110)
        /** @var int */
        public int $Hour1=0,

        // @DataMember(Order=120)
        /** @var int */
        public int $Hour2=0,

        // @DataMember(Order=130)
        /** @var int */
        public int $Hour3=0,

        // @DataMember(Order=140)
        /** @var int */
        public int $Hour4=0,

        // @DataMember(Order=150)
        /** @var int */
        public int $Hour5=0,

        // @DataMember(Order=160)
        /** @var int */
        public int $Hour6=0,

        // @DataMember(Order=170)
        /** @var int */
        public int $Hour7=0,

        // @DataMember(Order=180)
        /** @var int */
        public int $Hour8=0,

        // @DataMember(Order=190)
        /** @var int */
        public int $Hour9=0,

        // @DataMember(Order=200)
        /** @var int */
        public int $Hour10=0,

        // @DataMember(Order=210)
        /** @var int */
        public int $Hour11=0,

        // @DataMember(Order=220)
        /** @var int */
        public int $Hour12=0,

        // @DataMember(Order=230)
        /** @var int */
        public int $Hour13=0,

        // @DataMember(Order=240)
        /** @var int */
        public int $Hour14=0,

        // @DataMember(Order=250)
        /** @var int */
        public int $Hour15=0,

        // @DataMember(Order=260)
        /** @var int */
        public int $Hour16=0,

        // @DataMember(Order=270)
        /** @var int */
        public int $Hour17=0,

        // @DataMember(Order=280)
        /** @var int */
        public int $Hour18=0,

        // @DataMember(Order=290)
        /** @var int */
        public int $Hour19=0,

        // @DataMember(Order=300)
        /** @var int */
        public int $Hour20=0,

        // @DataMember(Order=310)
        /** @var int */
        public int $Hour21=0,

        // @DataMember(Order=320)
        /** @var int */
        public int $Hour22=0,

        // @DataMember(Order=330)
        /** @var int */
        public int $Hour23=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['RequestDate'])) $this->RequestDate = JsonConverters::from('DateTime', $o['RequestDate']);
        if (isset($o['Hour0'])) $this->Hour0 = $o['Hour0'];
        if (isset($o['Hour1'])) $this->Hour1 = $o['Hour1'];
        if (isset($o['Hour2'])) $this->Hour2 = $o['Hour2'];
        if (isset($o['Hour3'])) $this->Hour3 = $o['Hour3'];
        if (isset($o['Hour4'])) $this->Hour4 = $o['Hour4'];
        if (isset($o['Hour5'])) $this->Hour5 = $o['Hour5'];
        if (isset($o['Hour6'])) $this->Hour6 = $o['Hour6'];
        if (isset($o['Hour7'])) $this->Hour7 = $o['Hour7'];
        if (isset($o['Hour8'])) $this->Hour8 = $o['Hour8'];
        if (isset($o['Hour9'])) $this->Hour9 = $o['Hour9'];
        if (isset($o['Hour10'])) $this->Hour10 = $o['Hour10'];
        if (isset($o['Hour11'])) $this->Hour11 = $o['Hour11'];
        if (isset($o['Hour12'])) $this->Hour12 = $o['Hour12'];
        if (isset($o['Hour13'])) $this->Hour13 = $o['Hour13'];
        if (isset($o['Hour14'])) $this->Hour14 = $o['Hour14'];
        if (isset($o['Hour15'])) $this->Hour15 = $o['Hour15'];
        if (isset($o['Hour16'])) $this->Hour16 = $o['Hour16'];
        if (isset($o['Hour17'])) $this->Hour17 = $o['Hour17'];
        if (isset($o['Hour18'])) $this->Hour18 = $o['Hour18'];
        if (isset($o['Hour19'])) $this->Hour19 = $o['Hour19'];
        if (isset($o['Hour20'])) $this->Hour20 = $o['Hour20'];
        if (isset($o['Hour21'])) $this->Hour21 = $o['Hour21'];
        if (isset($o['Hour22'])) $this->Hour22 = $o['Hour22'];
        if (isset($o['Hour23'])) $this->Hour23 = $o['Hour23'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->RequestDate)) $o['RequestDate'] = JsonConverters::to('DateTime', $this->RequestDate);
        if (isset($this->Hour0)) $o['Hour0'] = $this->Hour0;
        if (isset($this->Hour1)) $o['Hour1'] = $this->Hour1;
        if (isset($this->Hour2)) $o['Hour2'] = $this->Hour2;
        if (isset($this->Hour3)) $o['Hour3'] = $this->Hour3;
        if (isset($this->Hour4)) $o['Hour4'] = $this->Hour4;
        if (isset($this->Hour5)) $o['Hour5'] = $this->Hour5;
        if (isset($this->Hour6)) $o['Hour6'] = $this->Hour6;
        if (isset($this->Hour7)) $o['Hour7'] = $this->Hour7;
        if (isset($this->Hour8)) $o['Hour8'] = $this->Hour8;
        if (isset($this->Hour9)) $o['Hour9'] = $this->Hour9;
        if (isset($this->Hour10)) $o['Hour10'] = $this->Hour10;
        if (isset($this->Hour11)) $o['Hour11'] = $this->Hour11;
        if (isset($this->Hour12)) $o['Hour12'] = $this->Hour12;
        if (isset($this->Hour13)) $o['Hour13'] = $this->Hour13;
        if (isset($this->Hour14)) $o['Hour14'] = $this->Hour14;
        if (isset($this->Hour15)) $o['Hour15'] = $this->Hour15;
        if (isset($this->Hour16)) $o['Hour16'] = $this->Hour16;
        if (isset($this->Hour17)) $o['Hour17'] = $this->Hour17;
        if (isset($this->Hour18)) $o['Hour18'] = $this->Hour18;
        if (isset($this->Hour19)) $o['Hour19'] = $this->Hour19;
        if (isset($this->Hour20)) $o['Hour20'] = $this->Hour20;
        if (isset($this->Hour21)) $o['Hour21'] = $this->Hour21;
        if (isset($this->Hour22)) $o['Hour22'] = $this->Hour22;
        if (isset($this->Hour23)) $o['Hour23'] = $this->Hour23;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="ResponseMetadata", Namespace="schemas.agentivity.com/types")
class AgentivityError implements JsonSerializable
{
    public function __construct(
        // @DataMember
        /** @var string|null */
        public ?string $ErrorCode=null,

        // @DataMember
        /** @var string|null */
        public ?string $Message=null,

        // @DataMember
        /** @var string|null */
        public ?string $StatusCode=null,

        // @DataMember
        /** @var string|null */
        public ?string $VerboseMessage=null
    ) {
    }

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

// @DataContract(Name="AgentivityResponse", Namespace="schemas.agentivity.com/types")
/**
 * @template TItem
 */
class CollectionResponse implements JsonSerializable
{
    public array $genericArgs = [];
    public static function create(array $genericArgs=[]): CollectionResponse {
        $to = new CollectionResponse();
        $to->genericArgs = $genericArgs;
        return $to;
    }

    public function __construct(
        // @DataMember(Order=1)
        /** @var ResponseMetadata|null */
        public mixed $ResponseMetadata=null,

        // @DataMember(Order=2, EmitDefaultValue=false)
        /** @var array<ApiRequestPerHour>|null */
        public mixed $ResponseReport=null,

        // @DataMember(Order=3, EmitDefaultValue=false)
        /** @var AgentivityError|null */
        public mixed $ResponseError=null
    ) {
    }

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

// @DataContract(Name="AgentivityResponse", Namespace="schemas.agentivity.com/types")
/**
 * @template CollectionResponse of BookingDetails
 */
class BookingDetailsByRefResponse extends CollectionResponse implements JsonSerializable
{
    /**
     * @param ResponseMetadata|null $ResponseMetadata
     * @param array<ApiRequestPerHour>|null $ResponseReport
     * @param AgentivityError|null $ResponseError
     */
    public function __construct(
        ?ResponseMetadata $ResponseMetadata=null,
        ?array $ResponseReport=null,
        ?AgentivityError $ResponseError=null
    ) {
        parent::__construct($ResponseMetadata,$ResponseReport,$ResponseError);
    }

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

// @Flags()
enum BookingDetailsOptions : int
{
    case None = 0;
    case Passengers = 1;
    case Itinerary = 2;
    case PassengersItinerary = 3;
    case DiEntries = 4;
    case Phones = 8;
    case Notepads = 16;
    case VendorRemarks = 32;
    case Tickets = 64;
    case Versions = 128;
    case VendorLocators = 256;
    case CustomFields = 512;
    case Emails = 1024;
    case ContactFields = 1032;
    case AccountValue = 2048;
    case EventDetails = 4096;
    case History = 4224;
    case EmailTrails = 8192;
    case AgentivityWarnings = 16384;
    case AirTicketingDueDates = 32768;
    case All = 65535;
}

// @DataContract(Namespace="schemas.agentivity.com/types")
class BookingDetailsByRef extends CompanyLevelRequestBase implements IRequestConsultantID, JsonSerializable
{
    /**
     * @param string|null $Offset
     * @param string|null $Limit
     * @param int $TotalRecords
     * @param int $ResponseRecords
     * @param string[]|null $OwningCompanyCode
     * @param string|null $UserName
     */
    public function __construct(
        ?string $Offset=null,
        ?string $Limit=null,
        int $TotalRecords=0,
        int $ResponseRecords=0,
        ?array $OwningCompanyCode=null,
        ?string $UserName=null,
        /** @description Agentivity Booking Reference */
        // @DataMember
        /** @var int */
        public int $AgentivityRef=0,

        /** @description Options to retrieve booking details (valid values are: Passengers, Itinerary, DiEntries, Phones, Notepads, VendorRemarks, Tickets, Versions, VendorLocators, CustomFields, Emails, AccountValue, EventDetails or EmailTrails). The option All can be used to get entire booking data. */
        // @DataMember
        /** @var BookingDetailsOptions|null */
        public ?BookingDetailsOptions $LoadOptions=null,

        /** @description Record locator */
        // @DataMember
        /** @var string|null */
        public ?string $RecordLocator=null,

        /** @description Date in format YYYYMMDD */
        // @DataMember
        /** @var string|null */
        public ?string $PNRCreationDate=null,

        /** @description Request Consultant ID (sign on) */
        // @DataMember
        /** @var string|null */
        public ?string $RequestConsultantID=null
    ) {
        parent::__construct($Offset,$Limit,$TotalRecords,$ResponseRecords,$OwningCompanyCode,$UserName);
    }

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

PHP BookingDetailsByRef DTOs

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

HTTP + XML

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

GET /BookingDetails HTTP/1.1 
Host: api.agentivity.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<AgentivityResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="schemas.agentivity.com/types">
  <ResponseMetadata>
    <Success>false</Success>
    <HasCache>false</HasCache>
    <HasPaging>false</HasPaging>
    <CacheMetadata>
      <IsFromCache>false</IsFromCache>
      <CachedAt>0001-01-01T00:00:00</CachedAt>
      <CacheExpiresAt>0001-01-01T00:00:00</CacheExpiresAt>
    </CacheMetadata>
    <PagingMetadata>
      <Limit>String</Limit>
      <Offset>String</Offset>
      <ResponseRecords>0</ResponseRecords>
      <TotalRecords>0</TotalRecords>
    </PagingMetadata>
  </ResponseMetadata>
  <ResponseReport>
    <BookingDetails>
      <AgentivityRef>0</AgentivityRef>
      <RecordLocator>String</RecordLocator>
      <PNRCreationDate>String</PNRCreationDate>
      <CreationDate>0001-01-01T00:00:00</CreationDate>
      <PNRTicketed>String</PNRTicketed>
      <Account>String</Account>
      <OwningConsultantID>String</OwningConsultantID>
      <OwningConsultant>String</OwningConsultant>
      <CrsDescription>String</CrsDescription>
      <LastActionConsultantID>String</LastActionConsultantID>
      <LastActionAgencyLocationID>String</LastActionAgencyLocationID>
      <OwningAgencyLocationID>String</OwningAgencyLocationID>
      <CreatingAgencyIata>String</CreatingAgencyIata>
      <CompanyID>0</CompanyID>
      <Passengers>
        <Passenger>
          <Id>0</Id>
          <FirstName>String</FirstName>
          <LastName>String</LastName>
          <FrequentFlyers>
            <FrequentFlyer>
              <Vendor>String</Vendor>
              <Number>String</Number>
              <FullNumber>String</FullNumber>
            </FrequentFlyer>
          </FrequentFlyers>
          <SequenceNbr>0</SequenceNbr>
          <LastNameElement>0</LastNameElement>
          <IsVip>false</IsVip>
          <TravellerGUID>String</TravellerGUID>
        </Passenger>
      </Passengers>
      <Phones>
        <Phone>
          <PhoneType>String</PhoneType>
          <City>String</City>
          <Number>String</Number>
          <SequenceNbr>0</SequenceNbr>
        </Phone>
      </Phones>
      <Notepads>
        <Notepad>
          <Remark>String</Remark>
          <CreatedDate>0001-01-01T00:00:00</CreatedDate>
          <CreatedTime>String</CreatedTime>
          <Qualifier>String</Qualifier>
          <SequenceNbr>0</SequenceNbr>
        </Notepad>
      </Notepads>
      <VendorRemarks>
        <VendorRemark>
          <DateStamp>0001-01-01T00:00:00</DateStamp>
          <Remark>String</Remark>
          <RemarkType>String</RemarkType>
          <RmkNum>0</RmkNum>
          <TimeStamp>String</TimeStamp>
          <TravelOrderIdentifier>0</TravelOrderIdentifier>
          <Vendor>String</Vendor>
          <VendorType>String</VendorType>
          <VendorRemarkID>0</VendorRemarkID>
        </VendorRemark>
      </VendorRemarks>
      <DiEntries>
        <DIEntry>
          <SequenceNbr>0</SequenceNbr>
          <Keyword>String</Keyword>
          <Remark>String</Remark>
        </DIEntry>
      </DiEntries>
      <Tickets>
        <Ticket>
          <SegmentNbr>0</SegmentNbr>
          <TicketNumber>String</TicketNumber>
          <TicketType>String</TicketType>
          <TicketDetailsAvailable>false</TicketDetailsAvailable>
        </Ticket>
      </Tickets>
      <Versions>
        <Version>
          <AgentivityRef>0</AgentivityRef>
          <DataBaseTimeStamp>0001-01-01T00:00:00</DataBaseTimeStamp>
          <EventType>String</EventType>
          <PnrTicketed>String</PnrTicketed>
          <LastActionAgentId>String</LastActionAgentId>
          <AirSegs>0</AirSegs>
          <AirPSegs>0</AirPSegs>
          <HtlSegs>0</HtlSegs>
          <HtlPSegs>0</HtlPSegs>
          <CarSegs>0</CarSegs>
          <CarPSegs>0</CarPSegs>
          <TrnPSegs>0</TrnPSegs>
          <OwningAgencyLocationID>String</OwningAgencyLocationID>
        </Version>
      </Versions>
      <VendorLocators>
        <VendorLocator>
          <AirSegmentNbr>0</AirSegmentNbr>
          <CarrierCode>String</CarrierCode>
          <VendorLocator>String</VendorLocator>
        </VendorLocator>
      </VendorLocators>
      <CustomFields>
        <CustomFieldValue>
          <PNRPropertiesCustomFieldID>String</PNRPropertiesCustomFieldID>
          <RecordLocator>String</RecordLocator>
          <PNRCreationDate>0001-01-01T00:00:00</PNRCreationDate>
          <FieldName>String</FieldName>
          <FieldValue>String</FieldValue>
          <CustomFieldID>0</CustomFieldID>
          <CreationDateTime>0001-01-01T00:00:00</CreationDateTime>
          <ElementNumber>0</ElementNumber>
          <GDS>String</GDS>
        </CustomFieldValue>
      </CustomFields>
      <Emails>
        <Email>
          <SequenceNbr>0</SequenceNbr>
          <EmailType>String</EmailType>
          <Email>String</Email>
        </Email>
      </Emails>
      <EventDetails>
        <EventDetail>
          <ItineraryEventTypeDetailID>0</ItineraryEventTypeDetailID>
          <AgentivityRef>0</AgentivityRef>
          <EventTypeDetail>String</EventTypeDetail>
          <OldData>String</OldData>
          <NewData>String</NewData>
          <DateTimeStamp>0001-01-01T00:00:00</DateTimeStamp>
          <EventTypeDetailID>0</EventTypeDetailID>
        </EventDetail>
      </EventDetails>
      <AccountLocations>
        <AccountLocation>
          <PrimaryAccountLocation>String</PrimaryAccountLocation>
          <SecondaryAccountLocation>String</SecondaryAccountLocation>
          <Valid>false</Valid>
          <ExactMatch>false</ExactMatch>
          <GDS>String</GDS>
        </AccountLocation>
      </AccountLocations>
      <EmailTrails>
        <BookingEmailTrail>
          <RecipientEmail>String</RecipientEmail>
          <DeliveryDetails>String</DeliveryDetails>
          <MailSentDateTime>0001-01-01T00:00:00</MailSentDateTime>
          <RecipientLastActivityEvent>String</RecipientLastActivityEvent>
          <EmailId>0</EmailId>
          <UserId>0</UserId>
          <SentResponseMessage>String</SentResponseMessage>
          <SentResponseErrorCode>0</SentResponseErrorCode>
          <DeliveredBookingID>0</DeliveredBookingID>
        </BookingEmailTrail>
      </EmailTrails>
      <AgentivityWarnings>
        <Warning>
          <Message>String</Message>
          <Vendor>String</Vendor>
          <WarningDateTime>0001-01-01T00:00:00</WarningDateTime>
          <OriginalRemark>String</OriginalRemark>
          <ClearedDateTime>0001-01-01T00:00:00</ClearedDateTime>
          <ClearedByConsultantID>String</ClearedByConsultantID>
          <PropertiesList>
            <Property>
              <Name>String</Name>
              <Value>String</Value>
            </Property>
          </PropertiesList>
        </Warning>
      </AgentivityWarnings>
      <AirlineTicketingDues>
        <TicketingDue>
          <Airline>String</Airline>
          <DueDate>0001-01-01T00:00:00</DueDate>
          <DueTime>String</DueTime>
        </TicketingDue>
      </AirlineTicketingDues>
      <CTCE>String</CTCE>
      <CTCM>String</CTCM>
      <CarbonTonnage>0</CarbonTonnage>
      <CarbonEmissions>
        <CarbonEmission>
          <Value>0</Value>
          <Unit>
            <Id>0</Id>
            <Symbol>String</Symbol>
            <Name>String</Name>
          </Unit>
          <Provider>
            <Id>0</Id>
            <Name>String</Name>
            <Description>String</Description>
            <LogoPath>String</LogoPath>
          </Provider>
          <CalculationDateTime>0001-01-01T00:00:00</CalculationDateTime>
          <CalculationDetails>
            <Id>0</Id>
            <Name>String</Name>
          </CalculationDetails>
        </CarbonEmission>
      </CarbonEmissions>
      <OwningCompanyCode>String</OwningCompanyCode>
      <Itinerary>
        <ItinerarySegment>
          <ArrivalTimeFormatted>String</ArrivalTimeFormatted>
          <BoardPoint>String</BoardPoint>
          <ChangeOfDayFormatted>String</ChangeOfDayFormatted>
          <DepartureTimeFormatted>String</DepartureTimeFormatted>
          <EndDate>String</EndDate>
          <Equipment>String</Equipment>
          <EquipmentCode>String</EquipmentCode>
          <OffPoint>String</OffPoint>
          <OperatorCode>String</OperatorCode>
          <OperatorService>String</OperatorService>
          <SegmentNbr>0</SegmentNbr>
          <SegmentStatus>String</SegmentStatus>
          <SegmentType>String</SegmentType>
          <ServiceCode>String</ServiceCode>
          <StartDate>String</StartDate>
          <TicketNumber>String</TicketNumber>
          <VendorLocators>String</VendorLocators>
        </ItinerarySegment>
      </Itinerary>
      <ItineraryFormatted>String</ItineraryFormatted>
    </BookingDetails>
  </ResponseReport>
  <ResponseError>
    <ErrorCode>String</ErrorCode>
    <Message>String</Message>
    <StatusCode>String</StatusCode>
    <VerboseMessage>String</VerboseMessage>
  </ResponseError>
</AgentivityResponse>