Agentivity API

<back to all web services

GetTicketDetails

The following routes are available for this service:
GET/TicketDetails/UserDepreciated, please use ticketdetails
GET/TicketDetails
<?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="TicketInfoFlightCoupon", Namespace="schemas.agentivity.com/types")
class TicketInfoFlightCoupon implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var string|null */
        public ?string $TktNumber=null,

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

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

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

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

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

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

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

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

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

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

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

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

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

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['TktNumber'])) $this->TktNumber = $o['TktNumber'];
        if (isset($o['CouponSequenceNbr'])) $this->CouponSequenceNbr = $o['CouponSequenceNbr'];
        if (isset($o['Carrier'])) $this->Carrier = $o['Carrier'];
        if (isset($o['FlightNbr'])) $this->FlightNbr = $o['FlightNbr'];
        if (isset($o['BoardPoint'])) $this->BoardPoint = $o['BoardPoint'];
        if (isset($o['OffPoint'])) $this->OffPoint = $o['OffPoint'];
        if (isset($o['FlightServiceClass'])) $this->FlightServiceClass = $o['FlightServiceClass'];
        if (isset($o['FlightDate'])) $this->FlightDate = JsonConverters::from('DateTime', $o['FlightDate']);
        if (isset($o['FlightCouponStatus'])) $this->FlightCouponStatus = $o['FlightCouponStatus'];
        if (isset($o['DateLastChecked'])) $this->DateLastChecked = JsonConverters::from('DateTime', $o['DateLastChecked']);
        if (isset($o['AirTktSegId'])) $this->AirTktSegId = $o['AirTktSegId'];
        if (isset($o['EligibleForRefund'])) $this->EligibleForRefund = $o['EligibleForRefund'];
        if (isset($o['EligibleForCovidStatus'])) $this->EligibleForCovidStatus = $o['EligibleForCovidStatus'];
        if (isset($o['FareBasis'])) $this->FareBasis = $o['FareBasis'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->TktNumber)) $o['TktNumber'] = $this->TktNumber;
        if (isset($this->CouponSequenceNbr)) $o['CouponSequenceNbr'] = $this->CouponSequenceNbr;
        if (isset($this->Carrier)) $o['Carrier'] = $this->Carrier;
        if (isset($this->FlightNbr)) $o['FlightNbr'] = $this->FlightNbr;
        if (isset($this->BoardPoint)) $o['BoardPoint'] = $this->BoardPoint;
        if (isset($this->OffPoint)) $o['OffPoint'] = $this->OffPoint;
        if (isset($this->FlightServiceClass)) $o['FlightServiceClass'] = $this->FlightServiceClass;
        if (isset($this->FlightDate)) $o['FlightDate'] = JsonConverters::to('DateTime', $this->FlightDate);
        if (isset($this->FlightCouponStatus)) $o['FlightCouponStatus'] = $this->FlightCouponStatus;
        if (isset($this->DateLastChecked)) $o['DateLastChecked'] = JsonConverters::to('DateTime', $this->DateLastChecked);
        if (isset($this->AirTktSegId)) $o['AirTktSegId'] = $this->AirTktSegId;
        if (isset($this->EligibleForRefund)) $o['EligibleForRefund'] = $this->EligibleForRefund;
        if (isset($this->EligibleForCovidStatus)) $o['EligibleForCovidStatus'] = $this->EligibleForCovidStatus;
        if (isset($this->FareBasis)) $o['FareBasis'] = $this->FareBasis;
        return empty($o) ? new class(){} : $o;
    }
}

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

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

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

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

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

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

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

        // @DataMember(Order=20)
        /** @var array<TicketTaxElement>|null */
        public ?array $TaxElements=null
    ) {
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        // @DataMember(Order=240)
        /** @var TicketTaxDetails|null */
        public ?TicketTaxDetails $Tax=null,

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

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['PassengerTicketID'])) $this->PassengerTicketID = $o['PassengerTicketID'];
        if (isset($o['TktNumber'])) $this->TktNumber = $o['TktNumber'];
        if (isset($o['RecordLocator'])) $this->RecordLocator = $o['RecordLocator'];
        if (isset($o['PNRCreationDate'])) $this->PNRCreationDate = JsonConverters::from('DateTime', $o['PNRCreationDate']);
        if (isset($o['TktIssueDate'])) $this->TktIssueDate = JsonConverters::from('DateTime', $o['TktIssueDate']);
        if (isset($o['PlatingCarrier'])) $this->PlatingCarrier = $o['PlatingCarrier'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['BAR'])) $this->BAR = $o['BAR'];
        if (isset($o['PAR'])) $this->PAR = $o['PAR'];
        if (isset($o['LastName'])) $this->LastName = $o['LastName'];
        if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
        if (isset($o['TicketExpiryDate'])) $this->TicketExpiryDate = JsonConverters::from('DateTime', $o['TicketExpiryDate']);
        if (isset($o['FOP'])) $this->FOP = $o['FOP'];
        if (isset($o['FopFare'])) $this->FopFare = $o['FopFare'];
        if (isset($o['FOPCurrency'])) $this->FOPCurrency = $o['FOPCurrency'];
        if (isset($o['PrintedCurrency'])) $this->PrintedCurrency = $o['PrintedCurrency'];
        if (isset($o['PrintedFare'])) $this->PrintedFare = $o['PrintedFare'];
        if (isset($o['CreditCardFOPAcct'])) $this->CreditCardFOPAcct = $o['CreditCardFOPAcct'];
        if (isset($o['OwningAgencyLocationID'])) $this->OwningAgencyLocationID = $o['OwningAgencyLocationID'];
        if (isset($o['IATA'])) $this->IATA = $o['IATA'];
        if (isset($o['Coupons'])) $this->Coupons = JsonConverters::fromArray('TicketInfoFlightCoupon', $o['Coupons']);
        if (isset($o['EligibleForRefund'])) $this->EligibleForRefund = $o['EligibleForRefund'];
        if (isset($o['EligibleForCovidStatus'])) $this->EligibleForCovidStatus = $o['EligibleForCovidStatus'];
        if (isset($o['TicketExchanges'])) $this->TicketExchanges = JsonConverters::fromArray('TicketExchange', $o['TicketExchanges']);
        if (isset($o['Tax'])) $this->Tax = JsonConverters::from('TicketTaxDetails', $o['Tax']);
        if (isset($o['OwningCompanyCode'])) $this->OwningCompanyCode = $o['OwningCompanyCode'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->PassengerTicketID)) $o['PassengerTicketID'] = $this->PassengerTicketID;
        if (isset($this->TktNumber)) $o['TktNumber'] = $this->TktNumber;
        if (isset($this->RecordLocator)) $o['RecordLocator'] = $this->RecordLocator;
        if (isset($this->PNRCreationDate)) $o['PNRCreationDate'] = JsonConverters::to('DateTime', $this->PNRCreationDate);
        if (isset($this->TktIssueDate)) $o['TktIssueDate'] = JsonConverters::to('DateTime', $this->TktIssueDate);
        if (isset($this->PlatingCarrier)) $o['PlatingCarrier'] = $this->PlatingCarrier;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->BAR)) $o['BAR'] = $this->BAR;
        if (isset($this->PAR)) $o['PAR'] = $this->PAR;
        if (isset($this->LastName)) $o['LastName'] = $this->LastName;
        if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
        if (isset($this->TicketExpiryDate)) $o['TicketExpiryDate'] = JsonConverters::to('DateTime', $this->TicketExpiryDate);
        if (isset($this->FOP)) $o['FOP'] = $this->FOP;
        if (isset($this->FopFare)) $o['FopFare'] = $this->FopFare;
        if (isset($this->FOPCurrency)) $o['FOPCurrency'] = $this->FOPCurrency;
        if (isset($this->PrintedCurrency)) $o['PrintedCurrency'] = $this->PrintedCurrency;
        if (isset($this->PrintedFare)) $o['PrintedFare'] = $this->PrintedFare;
        if (isset($this->CreditCardFOPAcct)) $o['CreditCardFOPAcct'] = $this->CreditCardFOPAcct;
        if (isset($this->OwningAgencyLocationID)) $o['OwningAgencyLocationID'] = $this->OwningAgencyLocationID;
        if (isset($this->IATA)) $o['IATA'] = $this->IATA;
        if (isset($this->Coupons)) $o['Coupons'] = JsonConverters::toArray('TicketInfoFlightCoupon', $this->Coupons);
        if (isset($this->EligibleForRefund)) $o['EligibleForRefund'] = $this->EligibleForRefund;
        if (isset($this->EligibleForCovidStatus)) $o['EligibleForCovidStatus'] = $this->EligibleForCovidStatus;
        if (isset($this->TicketExchanges)) $o['TicketExchanges'] = JsonConverters::toArray('TicketExchange', $this->TicketExchanges);
        if (isset($this->Tax)) $o['Tax'] = JsonConverters::to('TicketTaxDetails', $this->Tax);
        if (isset($this->OwningCompanyCode)) $o['OwningCompanyCode'] = $this->OwningCompanyCode;
        return empty($o) ? new class(){} : $o;
    }
}

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

    public function __construct(
        // @DataMember(Order=1, EmitDefaultValue=false)
        /** @var TItem|null */
        public mixed $Item=null
    ) {
    }

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

// @DataContract(Name="TicketInfo", Namespace="schemas.agentivity.com/types")
/**
 * @template Report2 of TicketDetailsItemResponse
 * @template Report21 of TicketInfo
 */
class TicketDetailsResponseReport extends Report2 implements JsonSerializable
{
    /**
     * @param TItem|null $Item
     */
    public function __construct(
        ?TItem $Item=null
    ) {
        parent::__construct($Item);
    }

    /** @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(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="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
 * @template TReport
 */
class ItemResponse2 implements JsonSerializable
{
    public array $genericArgs = [];
    public static function create(array $genericArgs=[]): ItemResponse2 {
        $to = new ItemResponse2();
        $to->genericArgs = $genericArgs;
        return $to;
    }

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

        // @DataMember(Order=2, EmitDefaultValue=false)
        /** @var TReport|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::from($this->genericArgs[1], $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::to($this->genericArgs[1], $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 ItemResponse2 of TicketInfo
 * @template ItemResponse21 of TicketDetailsResponseReport
 */
class TicketDetailsItemResponse extends ItemResponse2 implements JsonSerializable
{
    /**
     * @param ResponseMetadata|null $ResponseMetadata
     * @param TReport|null $ResponseReport
     * @param AgentivityError|null $ResponseError
     */
    public function __construct(
        ?ResponseMetadata $ResponseMetadata=null,
        ?TReport $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 GetTicketDetails 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 Ticket number */
        // @DataMember
        /** @var string */
        public string $TktNumber='',

        /** @description Cache Guid */
        // @DataMember
        /** @var string|null */
        public ?string $CacheGuid=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['TktNumber'])) $this->TktNumber = $o['TktNumber'];
        if (isset($o['CacheGuid'])) $this->CacheGuid = $o['CacheGuid'];
        if (isset($o['RequestConsultantID'])) $this->RequestConsultantID = $o['RequestConsultantID'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->TktNumber)) $o['TktNumber'] = $this->TktNumber;
        if (isset($this->CacheGuid)) $o['CacheGuid'] = $this->CacheGuid;
        if (isset($this->RequestConsultantID)) $o['RequestConsultantID'] = $this->RequestConsultantID;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetTicketDetails 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 /TicketDetails/User 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":{"Item":{"PassengerTicketID":0,"TktNumber":"String","RecordLocator":"String","PNRCreationDate":"\/Date(-62135596800000-0000)\/","TktIssueDate":"\/Date(-62135596800000-0000)\/","PlatingCarrier":"String","Status":"String","BAR":"String","PAR":"String","LastName":"String","FirstName":"String","TicketExpiryDate":"\/Date(-62135596800000-0000)\/","FOP":"String","FopFare":"String","FOPCurrency":"String","PrintedCurrency":"String","PrintedFare":"String","CreditCardFOPAcct":"String","OwningAgencyLocationID":"String","IATA":"String","Coupons":[{"TktNumber":"String","CouponSequenceNbr":0,"Carrier":"String","FlightNbr":"String","BoardPoint":"String","OffPoint":"String","FlightServiceClass":"String","FlightDate":"\/Date(-62135596800000-0000)\/","FlightCouponStatus":"String","DateLastChecked":"\/Date(-62135596800000-0000)\/","AirTktSegId":0,"EligibleForRefund":false,"EligibleForCovidStatus":false,"FareBasis":"String"}],"EligibleForRefund":false,"EligibleForCovidStatus":false,"TicketExchanges":[{"OriginalTktNumber":"String"}],"Tax":{"TotalAmt":0,"TaxElements":[{"Amt":0,"PrintedAmt":"String","Code":"String"}]},"OwningCompanyCode":"String"}},"ResponseError":{"ErrorCode":"String","Message":"String","StatusCode":"String","VerboseMessage":"String"}}