Agentivity API

<back to all web services

GetPNRSegments

The following routes are available for this service:
GET/PNRSegments
<?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 HostSystem implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=1)
        /** @var string|null */
        public ?string $Vendor=null,

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        // @DataMember(Order=3)
        /** @var Coupons|null */
        public ?Coupons $Coupons=null
    ) {
    }

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

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

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

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

        // @DataMember(Order=3)
        /** @var PNRSummaryTickets|null */
        public ?PNRSummaryTickets $Tickets=null
    ) {
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        // @DataMember(EmitDefaultValue=false)
        /** @var SeatingData|null */
        public ?SeatingData $SeatingData=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AirSegmentNbr'])) $this->AirSegmentNbr = $o['AirSegmentNbr'];
        if (isset($o['SegmentStatus'])) $this->SegmentStatus = $o['SegmentStatus'];
        if (isset($o['DepartureDate'])) $this->DepartureDate = $o['DepartureDate'];
        if (isset($o['DepartureTime'])) $this->DepartureTime = $o['DepartureTime'];
        if (isset($o['CarrierCode'])) $this->CarrierCode = $o['CarrierCode'];
        if (isset($o['BoardPoint'])) $this->BoardPoint = $o['BoardPoint'];
        if (isset($o['OffPoint'])) $this->OffPoint = $o['OffPoint'];
        if (isset($o['FlightNbr'])) $this->FlightNbr = $o['FlightNbr'];
        if (isset($o['BookingCode'])) $this->BookingCode = $o['BookingCode'];
        if (isset($o['ArrivalTime'])) $this->ArrivalTime = $o['ArrivalTime'];
        if (isset($o['ChangeOfDay'])) $this->ChangeOfDay = $o['ChangeOfDay'];
        if (isset($o['ConnectionIndicator'])) $this->ConnectionIndicator = $o['ConnectionIndicator'];
        if (isset($o['OperatingCarrierCode'])) $this->OperatingCarrierCode = $o['OperatingCarrierCode'];
        if (isset($o['OperatingCarrierName'])) $this->OperatingCarrierName = $o['OperatingCarrierName'];
        if (isset($o['JourneyTime'])) $this->JourneyTime = $o['JourneyTime'];
        if (isset($o['NbrSeats'])) $this->NbrSeats = $o['NbrSeats'];
        if (isset($o['SeatingData'])) $this->SeatingData = JsonConverters::from('SeatingData', $o['SeatingData']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->AirSegmentNbr)) $o['AirSegmentNbr'] = $this->AirSegmentNbr;
        if (isset($this->SegmentStatus)) $o['SegmentStatus'] = $this->SegmentStatus;
        if (isset($this->DepartureDate)) $o['DepartureDate'] = $this->DepartureDate;
        if (isset($this->DepartureTime)) $o['DepartureTime'] = $this->DepartureTime;
        if (isset($this->CarrierCode)) $o['CarrierCode'] = $this->CarrierCode;
        if (isset($this->BoardPoint)) $o['BoardPoint'] = $this->BoardPoint;
        if (isset($this->OffPoint)) $o['OffPoint'] = $this->OffPoint;
        if (isset($this->FlightNbr)) $o['FlightNbr'] = $this->FlightNbr;
        if (isset($this->BookingCode)) $o['BookingCode'] = $this->BookingCode;
        if (isset($this->ArrivalTime)) $o['ArrivalTime'] = $this->ArrivalTime;
        if (isset($this->ChangeOfDay)) $o['ChangeOfDay'] = $this->ChangeOfDay;
        if (isset($this->ConnectionIndicator)) $o['ConnectionIndicator'] = $this->ConnectionIndicator;
        if (isset($this->OperatingCarrierCode)) $o['OperatingCarrierCode'] = $this->OperatingCarrierCode;
        if (isset($this->OperatingCarrierName)) $o['OperatingCarrierName'] = $this->OperatingCarrierName;
        if (isset($this->JourneyTime)) $o['JourneyTime'] = $this->JourneyTime;
        if (isset($this->NbrSeats)) $o['NbrSeats'] = $this->NbrSeats;
        if (isset($this->SeatingData)) $o['SeatingData'] = JsonConverters::to('SeatingData', $this->SeatingData);
        return empty($o) ? new class(){} : $o;
    }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        // @DataMember
        /** @var int */
        public int $NbrOfCars=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CarSegmentNbr'])) $this->CarSegmentNbr = $o['CarSegmentNbr'];
        if (isset($o['SegmentStatus'])) $this->SegmentStatus = $o['SegmentStatus'];
        if (isset($o['PickUpDate'])) $this->PickUpDate = $o['PickUpDate'];
        if (isset($o['PickUpTime'])) $this->PickUpTime = $o['PickUpTime'];
        if (isset($o['AirportCode'])) $this->AirportCode = $o['AirportCode'];
        if (isset($o['CarLocationCategory'])) $this->CarLocationCategory = $o['CarLocationCategory'];
        if (isset($o['DropOffDate'])) $this->DropOffDate = $o['DropOffDate'];
        if (isset($o['DropOffTime'])) $this->DropOffTime = $o['DropOffTime'];
        if (isset($o['ConfirmationNbr'])) $this->ConfirmationNbr = $o['ConfirmationNbr'];
        if (isset($o['CarVendorCode'])) $this->CarVendorCode = $o['CarVendorCode'];
        if (isset($o['CarRateType'])) $this->CarRateType = $o['CarRateType'];
        if (isset($o['CarRateCode'])) $this->CarRateCode = $o['CarRateCode'];
        if (isset($o['CarType'])) $this->CarType = $o['CarType'];
        if (isset($o['CarYieldManagementNbr'])) $this->CarYieldManagementNbr = $o['CarYieldManagementNbr'];
        if (isset($o['RateAmount'])) $this->RateAmount = $o['RateAmount'];
        if (isset($o['RateGuaranteeIndicator'])) $this->RateGuaranteeIndicator = $o['RateGuaranteeIndicator'];
        if (isset($o['MilesKilometerIndicator'])) $this->MilesKilometerIndicator = $o['MilesKilometerIndicator'];
        if (isset($o['DistanceAllowance'])) $this->DistanceAllowance = $o['DistanceAllowance'];
        if (isset($o['DistanceRateAmount'])) $this->DistanceRateAmount = $o['DistanceRateAmount'];
        if (isset($o['CurrencyCode'])) $this->CurrencyCode = $o['CurrencyCode'];
        if (isset($o['NbrOfCars'])) $this->NbrOfCars = $o['NbrOfCars'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CarSegmentNbr)) $o['CarSegmentNbr'] = $this->CarSegmentNbr;
        if (isset($this->SegmentStatus)) $o['SegmentStatus'] = $this->SegmentStatus;
        if (isset($this->PickUpDate)) $o['PickUpDate'] = $this->PickUpDate;
        if (isset($this->PickUpTime)) $o['PickUpTime'] = $this->PickUpTime;
        if (isset($this->AirportCode)) $o['AirportCode'] = $this->AirportCode;
        if (isset($this->CarLocationCategory)) $o['CarLocationCategory'] = $this->CarLocationCategory;
        if (isset($this->DropOffDate)) $o['DropOffDate'] = $this->DropOffDate;
        if (isset($this->DropOffTime)) $o['DropOffTime'] = $this->DropOffTime;
        if (isset($this->ConfirmationNbr)) $o['ConfirmationNbr'] = $this->ConfirmationNbr;
        if (isset($this->CarVendorCode)) $o['CarVendorCode'] = $this->CarVendorCode;
        if (isset($this->CarRateType)) $o['CarRateType'] = $this->CarRateType;
        if (isset($this->CarRateCode)) $o['CarRateCode'] = $this->CarRateCode;
        if (isset($this->CarType)) $o['CarType'] = $this->CarType;
        if (isset($this->CarYieldManagementNbr)) $o['CarYieldManagementNbr'] = $this->CarYieldManagementNbr;
        if (isset($this->RateAmount)) $o['RateAmount'] = $this->RateAmount;
        if (isset($this->RateGuaranteeIndicator)) $o['RateGuaranteeIndicator'] = $this->RateGuaranteeIndicator;
        if (isset($this->MilesKilometerIndicator)) $o['MilesKilometerIndicator'] = $this->MilesKilometerIndicator;
        if (isset($this->DistanceAllowance)) $o['DistanceAllowance'] = $this->DistanceAllowance;
        if (isset($this->DistanceRateAmount)) $o['DistanceRateAmount'] = $this->DistanceRateAmount;
        if (isset($this->CurrencyCode)) $o['CurrencyCode'] = $this->CurrencyCode;
        if (isset($this->NbrOfCars)) $o['NbrOfCars'] = $this->NbrOfCars;
        return empty($o) ? new class(){} : $o;
    }
}

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

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

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

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

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

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

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

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

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

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

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

        // @DataMember(Order=22)
        /** @var int */
        public int $NbrRooms=0,

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

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

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

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

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

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['HotelSegmentNbr'])) $this->HotelSegmentNbr = $o['HotelSegmentNbr'];
        if (isset($o['StatusCode'])) $this->StatusCode = $o['StatusCode'];
        if (isset($o['ArrivalDate'])) $this->ArrivalDate = $o['ArrivalDate'];
        if (isset($o['DepartureDate'])) $this->DepartureDate = $o['DepartureDate'];
        if (isset($o['PropertyName'])) $this->PropertyName = $o['PropertyName'];
        if (isset($o['ConfirmationNbr'])) $this->ConfirmationNbr = $o['ConfirmationNbr'];
        if (isset($o['Currency'])) $this->Currency = $o['Currency'];
        if (isset($o['Rate'])) $this->Rate = $o['Rate'];
        if (isset($o['RoomBookingCode'])) $this->RoomBookingCode = $o['RoomBookingCode'];
        if (isset($o['NbrNights'])) $this->NbrNights = $o['NbrNights'];
        if (isset($o['MultiLevelRateCode'])) $this->MultiLevelRateCode = $o['MultiLevelRateCode'];
        if (isset($o['NbrRooms'])) $this->NbrRooms = $o['NbrRooms'];
        if (isset($o['BookedInName'])) $this->BookedInName = $o['BookedInName'];
        if (isset($o['ServiceInformation'])) $this->ServiceInformation = $o['ServiceInformation'];
        if (isset($o['PropertyCityCode'])) $this->PropertyCityCode = $o['PropertyCityCode'];
        if (isset($o['SegmentStatus'])) $this->SegmentStatus = $o['SegmentStatus'];
        if (isset($o['HotelVendorCode'])) $this->HotelVendorCode = $o['HotelVendorCode'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->HotelSegmentNbr)) $o['HotelSegmentNbr'] = $this->HotelSegmentNbr;
        if (isset($this->StatusCode)) $o['StatusCode'] = $this->StatusCode;
        if (isset($this->ArrivalDate)) $o['ArrivalDate'] = $this->ArrivalDate;
        if (isset($this->DepartureDate)) $o['DepartureDate'] = $this->DepartureDate;
        if (isset($this->PropertyName)) $o['PropertyName'] = $this->PropertyName;
        if (isset($this->ConfirmationNbr)) $o['ConfirmationNbr'] = $this->ConfirmationNbr;
        if (isset($this->Currency)) $o['Currency'] = $this->Currency;
        if (isset($this->Rate)) $o['Rate'] = $this->Rate;
        if (isset($this->RoomBookingCode)) $o['RoomBookingCode'] = $this->RoomBookingCode;
        if (isset($this->NbrNights)) $o['NbrNights'] = $this->NbrNights;
        if (isset($this->MultiLevelRateCode)) $o['MultiLevelRateCode'] = $this->MultiLevelRateCode;
        if (isset($this->NbrRooms)) $o['NbrRooms'] = $this->NbrRooms;
        if (isset($this->BookedInName)) $o['BookedInName'] = $this->BookedInName;
        if (isset($this->ServiceInformation)) $o['ServiceInformation'] = $this->ServiceInformation;
        if (isset($this->PropertyCityCode)) $o['PropertyCityCode'] = $this->PropertyCityCode;
        if (isset($this->SegmentStatus)) $o['SegmentStatus'] = $this->SegmentStatus;
        if (isset($this->HotelVendorCode)) $o['HotelVendorCode'] = $this->HotelVendorCode;
        return empty($o) ? new class(){} : $o;
    }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['SegmentStatus'])) $this->SegmentStatus = $o['SegmentStatus'];
        if (isset($o['StartDate'])) $this->StartDate = $o['StartDate'];
        if (isset($o['DepartureDate'])) $this->DepartureDate = $o['DepartureDate'];
        if (isset($o['NbrNights'])) $this->NbrNights = $o['NbrNights'];
        if (isset($o['VendorCode'])) $this->VendorCode = $o['VendorCode'];
        if (isset($o['CityCode'])) $this->CityCode = $o['CityCode'];
        if (isset($o['SegmentType'])) $this->SegmentType = $o['SegmentType'];
        if (isset($o['Text'])) $this->Text = $o['Text'];
        if (isset($o['Passenger'])) $this->Passenger = $o['Passenger'];
        if (isset($o['Address'])) $this->Address = $o['Address'];
        if (isset($o['BookingReasonCode'])) $this->BookingReasonCode = $o['BookingReasonCode'];
        if (isset($o['BookingSource'])) $this->BookingSource = $o['BookingSource'];
        if (isset($o['CommissionInformation'])) $this->CommissionInformation = $o['CommissionInformation'];
        if (isset($o['ConfirmationNumber'])) $this->ConfirmationNumber = $o['ConfirmationNumber'];
        if (isset($o['RateCode'])) $this->RateCode = $o['RateCode'];
        if (isset($o['RateQuoted'])) $this->RateQuoted = $o['RateQuoted'];
        if (isset($o['RateAccessCode'])) $this->RateAccessCode = $o['RateAccessCode'];
        if (isset($o['PropertyName'])) $this->PropertyName = $o['PropertyName'];
        if (isset($o['PropertyNumber'])) $this->PropertyNumber = $o['PropertyNumber'];
        if (isset($o['ServiceInformation'])) $this->ServiceInformation = $o['ServiceInformation'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->SegmentStatus)) $o['SegmentStatus'] = $this->SegmentStatus;
        if (isset($this->StartDate)) $o['StartDate'] = $this->StartDate;
        if (isset($this->DepartureDate)) $o['DepartureDate'] = $this->DepartureDate;
        if (isset($this->NbrNights)) $o['NbrNights'] = $this->NbrNights;
        if (isset($this->VendorCode)) $o['VendorCode'] = $this->VendorCode;
        if (isset($this->CityCode)) $o['CityCode'] = $this->CityCode;
        if (isset($this->SegmentType)) $o['SegmentType'] = $this->SegmentType;
        if (isset($this->Text)) $o['Text'] = $this->Text;
        if (isset($this->Passenger)) $o['Passenger'] = $this->Passenger;
        if (isset($this->Address)) $o['Address'] = $this->Address;
        if (isset($this->BookingReasonCode)) $o['BookingReasonCode'] = $this->BookingReasonCode;
        if (isset($this->BookingSource)) $o['BookingSource'] = $this->BookingSource;
        if (isset($this->CommissionInformation)) $o['CommissionInformation'] = $this->CommissionInformation;
        if (isset($this->ConfirmationNumber)) $o['ConfirmationNumber'] = $this->ConfirmationNumber;
        if (isset($this->RateCode)) $o['RateCode'] = $this->RateCode;
        if (isset($this->RateQuoted)) $o['RateQuoted'] = $this->RateQuoted;
        if (isset($this->RateAccessCode)) $o['RateAccessCode'] = $this->RateAccessCode;
        if (isset($this->PropertyName)) $o['PropertyName'] = $this->PropertyName;
        if (isset($this->PropertyNumber)) $o['PropertyNumber'] = $this->PropertyNumber;
        if (isset($this->ServiceInformation)) $o['ServiceInformation'] = $this->ServiceInformation;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="Segments", Namespace="schemas.agentivity.com/types")
class Segments implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=2, EmitDefaultValue=false)
        /** @var array<AirSegment>|null */
        public ?array $AirSegments=null,

        // @DataMember(Order=3, EmitDefaultValue=false)
        /** @var array<CarSegment>|null */
        public ?array $CarSegments=null,

        // @DataMember(Order=4, EmitDefaultValue=false)
        /** @var array<HotelSegmentDepreciated>|null */
        public ?array $HotelSegments=null,

        // @DataMember(Order=5, EmitDefaultValue=false)
        /** @var array<PassiveSegment>|null */
        public ?array $PassiveSegments=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AirSegments'])) $this->AirSegments = JsonConverters::fromArray('AirSegment', $o['AirSegments']);
        if (isset($o['CarSegments'])) $this->CarSegments = JsonConverters::fromArray('CarSegment', $o['CarSegments']);
        if (isset($o['HotelSegments'])) $this->HotelSegments = JsonConverters::fromArray('HotelSegmentDepreciated', $o['HotelSegments']);
        if (isset($o['PassiveSegments'])) $this->PassiveSegments = JsonConverters::fromArray('PassiveSegment', $o['PassiveSegments']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->AirSegments)) $o['AirSegments'] = JsonConverters::toArray('AirSegment', $this->AirSegments);
        if (isset($this->CarSegments)) $o['CarSegments'] = JsonConverters::toArray('CarSegment', $this->CarSegments);
        if (isset($this->HotelSegments)) $o['HotelSegments'] = JsonConverters::toArray('HotelSegmentDepreciated', $this->HotelSegments);
        if (isset($this->PassiveSegments)) $o['PassiveSegments'] = JsonConverters::toArray('PassiveSegment', $this->PassiveSegments);
        return empty($o) ? new class(){} : $o;
    }
}

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

        // @DataMember(Order=20)
        /** @var Segments|null */
        public ?Segments $Segments=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Summary'])) $this->Summary = JsonConverters::from('PNRSummary', $o['Summary']);
        if (isset($o['Segments'])) $this->Segments = JsonConverters::from('Segments', $o['Segments']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Summary)) $o['Summary'] = JsonConverters::to('PNRSummary', $this->Summary);
        if (isset($this->Segments)) $o['Segments'] = JsonConverters::to('Segments', $this->Segments);
        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 PNRSegments
 */
class GetPNRSegmentsResponse 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;
    }
}

// @DataContract(Namespace="schemas.agentivity.com/types")
class GetPNRSegments extends PagingMetadata implements 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 Record locator */
        // @DataMember
        /** @var string */
        public string $RecordLocator='',

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

        /** @description Type of segment */
        // @DataMember
        /** @var string[]|null */
        public ?array $SegmentType=null,

        /** @description Type of passive segment */
        // @DataMember
        /** @var string[]|null */
        public ?array $PassiveSegmentType=null
    ) {
        parent::__construct($Offset,$Limit,$TotalRecords,$ResponseRecords);
    }

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

PHP GetPNRSegments DTOs

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

HTTP + OTHER

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

GET /PNRSegments HTTP/1.1 
Host: api.agentivity.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"ResponseMetadata":{"Success":false,"HasCache":false,"HasPaging":false,"CacheMetadata":{"IsFromCache":false,"CachedAt":"\/Date(-62135596800000-0000)\/","CacheExpiresAt":"\/Date(-62135596800000-0000)\/"},"PagingMetadata":{"Offset":"String","Limit":"String","TotalRecords":0,"ResponseRecords":0}},"ResponseReport":[{"Summary":{"RecordLocator":"String","AirlineReferences":[{"Vendor":"String","VendorLocator":"String"}],"Tickets":[{"TktNumber":"String","Passenger":{"LastName":"String","FirstName":"String"},"Coupons":[{"CouponSequenceNbr":"String","CouponBoardPoint":"String","CouponOffPoint":"String","Carrier":"String","FlightNbr":"String","FlightDate":"String","FlightTime":"String"}]}]},"Segments":{"AirSegments":[{"AirSegmentNbr":0,"SegmentStatus":"String","DepartureDate":"String","DepartureTime":"String","CarrierCode":"String","BoardPoint":"String","OffPoint":"String","FlightNbr":"String","BookingCode":"String","ArrivalTime":"String","ChangeOfDay":"String","ConnectionIndicator":"String","OperatingCarrierCode":"String","OperatingCarrierName":"String","JourneyTime":"String","NbrSeats":0,"SeatingData":[{"SeatLocation":"String","SeatStatusCode":"String"}]}],"CarSegments":[{"CarSegmentNbr":0,"SegmentStatus":"String","PickUpDate":"String","PickUpTime":"String","AirportCode":"String","CarLocationCategory":"String","DropOffDate":"String","DropOffTime":"String","ConfirmationNbr":"String","CarVendorCode":"String","CarRateType":"String","CarRateCode":"String","CarType":"String","CarYieldManagementNbr":"String","RateAmount":"String","RateGuaranteeIndicator":"String","MilesKilometerIndicator":"String","DistanceAllowance":"String","DistanceRateAmount":"String","CurrencyCode":"String","NbrOfCars":0}],"HotelSegments":[{"HotelSegmentNbr":"String","StatusCode":"String","ArrivalDate":"String","DepartureDate":"String","PropertyName":"String","ConfirmationNbr":"String","Currency":"String","Rate":"String","RoomBookingCode":"String","NbrNights":0,"MultiLevelRateCode":"String","NbrRooms":0,"BookedInName":"String","ServiceInformation":"String","PropertyCityCode":"String","SegmentStatus":"String","HotelVendorCode":"String"}],"PassiveSegments":[{"SegmentStatus":"String","StartDate":"String","DepartureDate":"String","NbrNights":"String","VendorCode":"String","CityCode":"String","SegmentType":"String","Text":"String","Passenger":"String","Address":"String","BookingReasonCode":"String","BookingSource":"String","CommissionInformation":"String","ConfirmationNumber":"String","RateCode":"String","RateQuoted":"String","RateAccessCode":"String","PropertyName":"String","PropertyNumber":"String","ServiceInformation":"String"}]}}],"ResponseError":{"ErrorCode":"String","Message":"String","StatusCode":"String","VerboseMessage":"String"}}