Agentivity API

<back to all web services

GetTicketCouponsByStatusCode

The following routes are available for this service:
GET/TicketCouponsByStatusCode
<?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="CustomField", Namespace="schemas.agentivity.com/types")
class CustomFieldData implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=20)
        /** @var string|null */
        public ?string $FieldName=null,

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

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

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

// @DataContract(Name="TicketCouponsByStatusCode", Namespace="schemas.agentivity.com/types")
class TicketCouponsByStatusCode implements IBookingIdentifier, ICustomFields, JsonSerializable
{
    public function __construct(
        // @DataMember(Order=5)
        /** @var string|null */
        public ?string $CompanyName=null,

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        // @DataMember(Order=580)
        /** @var CustomFieldsCollection|null */
        public ?CustomFieldsCollection $CustomFields=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CompanyName'])) $this->CompanyName = $o['CompanyName'];
        if (isset($o['TktNumber'])) $this->TktNumber = $o['TktNumber'];
        if (isset($o['RN'])) $this->RN = $o['RN'];
        if (isset($o['AirTktSegId'])) $this->AirTktSegId = $o['AirTktSegId'];
        if (isset($o['VndIssueDt'])) $this->VndIssueDt = JsonConverters::from('DateTime', $o['VndIssueDt']);
        if (isset($o['RecordLocator'])) $this->RecordLocator = $o['RecordLocator'];
        if (isset($o['Passenger'])) $this->Passenger = $o['Passenger'];
        if (isset($o['TravAgntID'])) $this->TravAgntID = $o['TravAgntID'];
        if (isset($o['OwningConsultantID'])) $this->OwningConsultantID = $o['OwningConsultantID'];
        if (isset($o['FOPFare'])) $this->FOPFare = $o['FOPFare'];
        if (isset($o['BaseFare'])) $this->BaseFare = $o['BaseFare'];
        if (isset($o['FOP'])) $this->FOP = $o['FOP'];
        if (isset($o['TotalTax'])) $this->TotalTax = $o['TotalTax'];
        if (isset($o['Tax1Code'])) $this->Tax1Code = $o['Tax1Code'];
        if (isset($o['Tax1Amt'])) $this->Tax1Amt = $o['Tax1Amt'];
        if (isset($o['Tax2Code'])) $this->Tax2Code = $o['Tax2Code'];
        if (isset($o['Tax2Amt'])) $this->Tax2Amt = $o['Tax2Amt'];
        if (isset($o['Tax3Code'])) $this->Tax3Code = $o['Tax3Code'];
        if (isset($o['Tax3Amt'])) $this->Tax3Amt = $o['Tax3Amt'];
        if (isset($o['Tax4Code'])) $this->Tax4Code = $o['Tax4Code'];
        if (isset($o['Tax4Amt'])) $this->Tax4Amt = $o['Tax4Amt'];
        if (isset($o['Tax5Code'])) $this->Tax5Code = $o['Tax5Code'];
        if (isset($o['Tax5Amt'])) $this->Tax5Amt = $o['Tax5Amt'];
        if (isset($o['Account'])) $this->Account = $o['Account'];
        if (isset($o['ExchangedForTicket'])) $this->ExchangedForTicket = $o['ExchangedForTicket'];
        if (isset($o['CouponSequenceNbr'])) $this->CouponSequenceNbr = $o['CouponSequenceNbr'];
        if (isset($o['Carrier'])) $this->Carrier = $o['Carrier'];
        if (isset($o['BoardPoint'])) $this->BoardPoint = $o['BoardPoint'];
        if (isset($o['OffPoint'])) $this->OffPoint = $o['OffPoint'];
        if (isset($o['FlightDate'])) $this->FlightDate = JsonConverters::from('DateTime', $o['FlightDate']);
        if (isset($o['FlightServiceClass'])) $this->FlightServiceClass = $o['FlightServiceClass'];
        if (isset($o['FareBasis'])) $this->FareBasis = $o['FareBasis'];
        if (isset($o['FlightCouponStatus'])) $this->FlightCouponStatus = $o['FlightCouponStatus'];
        if (isset($o['DateLastChecked'])) $this->DateLastChecked = JsonConverters::from('DateTime', $o['DateLastChecked']);
        if (isset($o['PCC'])) $this->PCC = $o['PCC'];
        if (isset($o['AirlineCode'])) $this->AirlineCode = $o['AirlineCode'];
        if (isset($o['OwningCompanyCode'])) $this->OwningCompanyCode = $o['OwningCompanyCode'];
        if (isset($o['CreditCurrency'])) $this->CreditCurrency = $o['CreditCurrency'];
        if (isset($o['CreditValue'])) $this->CreditValue = $o['CreditValue'];
        if (isset($o['FlightServiceClassName'])) $this->FlightServiceClassName = $o['FlightServiceClassName'];
        if (isset($o['FlownKM'])) $this->FlownKM = $o['FlownKM'];
        if (isset($o['BAR'])) $this->BAR = $o['BAR'];
        if (isset($o['PNRCreationDate'])) $this->PNRCreationDate = JsonConverters::from('DateTime', $o['PNRCreationDate']);
        if (isset($o['AgentivityRef'])) $this->AgentivityRef = $o['AgentivityRef'];
        if (isset($o['CustomFields'])) $this->CustomFields = JsonConverters::from('CustomFieldsCollection', $o['CustomFields']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CompanyName)) $o['CompanyName'] = $this->CompanyName;
        if (isset($this->TktNumber)) $o['TktNumber'] = $this->TktNumber;
        if (isset($this->RN)) $o['RN'] = $this->RN;
        if (isset($this->AirTktSegId)) $o['AirTktSegId'] = $this->AirTktSegId;
        if (isset($this->VndIssueDt)) $o['VndIssueDt'] = JsonConverters::to('DateTime', $this->VndIssueDt);
        if (isset($this->RecordLocator)) $o['RecordLocator'] = $this->RecordLocator;
        if (isset($this->Passenger)) $o['Passenger'] = $this->Passenger;
        if (isset($this->TravAgntID)) $o['TravAgntID'] = $this->TravAgntID;
        if (isset($this->OwningConsultantID)) $o['OwningConsultantID'] = $this->OwningConsultantID;
        if (isset($this->FOPFare)) $o['FOPFare'] = $this->FOPFare;
        if (isset($this->BaseFare)) $o['BaseFare'] = $this->BaseFare;
        if (isset($this->FOP)) $o['FOP'] = $this->FOP;
        if (isset($this->TotalTax)) $o['TotalTax'] = $this->TotalTax;
        if (isset($this->Tax1Code)) $o['Tax1Code'] = $this->Tax1Code;
        if (isset($this->Tax1Amt)) $o['Tax1Amt'] = $this->Tax1Amt;
        if (isset($this->Tax2Code)) $o['Tax2Code'] = $this->Tax2Code;
        if (isset($this->Tax2Amt)) $o['Tax2Amt'] = $this->Tax2Amt;
        if (isset($this->Tax3Code)) $o['Tax3Code'] = $this->Tax3Code;
        if (isset($this->Tax3Amt)) $o['Tax3Amt'] = $this->Tax3Amt;
        if (isset($this->Tax4Code)) $o['Tax4Code'] = $this->Tax4Code;
        if (isset($this->Tax4Amt)) $o['Tax4Amt'] = $this->Tax4Amt;
        if (isset($this->Tax5Code)) $o['Tax5Code'] = $this->Tax5Code;
        if (isset($this->Tax5Amt)) $o['Tax5Amt'] = $this->Tax5Amt;
        if (isset($this->Account)) $o['Account'] = $this->Account;
        if (isset($this->ExchangedForTicket)) $o['ExchangedForTicket'] = $this->ExchangedForTicket;
        if (isset($this->CouponSequenceNbr)) $o['CouponSequenceNbr'] = $this->CouponSequenceNbr;
        if (isset($this->Carrier)) $o['Carrier'] = $this->Carrier;
        if (isset($this->BoardPoint)) $o['BoardPoint'] = $this->BoardPoint;
        if (isset($this->OffPoint)) $o['OffPoint'] = $this->OffPoint;
        if (isset($this->FlightDate)) $o['FlightDate'] = JsonConverters::to('DateTime', $this->FlightDate);
        if (isset($this->FlightServiceClass)) $o['FlightServiceClass'] = $this->FlightServiceClass;
        if (isset($this->FareBasis)) $o['FareBasis'] = $this->FareBasis;
        if (isset($this->FlightCouponStatus)) $o['FlightCouponStatus'] = $this->FlightCouponStatus;
        if (isset($this->DateLastChecked)) $o['DateLastChecked'] = JsonConverters::to('DateTime', $this->DateLastChecked);
        if (isset($this->PCC)) $o['PCC'] = $this->PCC;
        if (isset($this->AirlineCode)) $o['AirlineCode'] = $this->AirlineCode;
        if (isset($this->OwningCompanyCode)) $o['OwningCompanyCode'] = $this->OwningCompanyCode;
        if (isset($this->CreditCurrency)) $o['CreditCurrency'] = $this->CreditCurrency;
        if (isset($this->CreditValue)) $o['CreditValue'] = $this->CreditValue;
        if (isset($this->FlightServiceClassName)) $o['FlightServiceClassName'] = $this->FlightServiceClassName;
        if (isset($this->FlownKM)) $o['FlownKM'] = $this->FlownKM;
        if (isset($this->BAR)) $o['BAR'] = $this->BAR;
        if (isset($this->PNRCreationDate)) $o['PNRCreationDate'] = JsonConverters::to('DateTime', $this->PNRCreationDate);
        if (isset($this->AgentivityRef)) $o['AgentivityRef'] = $this->AgentivityRef;
        if (isset($this->CustomFields)) $o['CustomFields'] = JsonConverters::to('CustomFieldsCollection', $this->CustomFields);
        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 TicketCouponsByStatusCode
 */
class TicketCouponsByStatusCodeResponse 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 GetTicketCouponsByStatusCode 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 Date in format YYYYMMDD */
        // @DataMember
        /** @var string */
        public string $DateStart='',

        /** @description Date in format YYYYMMDD */
        // @DataMember
        /** @var string */
        public string $DateEnd='',

        /** @description Travel agent ID */
        // @DataMember
        /** @var string|null */
        public ?string $TravAgntID=null,

        /** @description Comma Delimited List of Accounts */
        // @DataMember
        /** @var string[]|null */
        public ?array $Account=null,

        /** @description Comma Delimited List of PCCs */
        // @DataMember
        /** @var string[]|null */
        public ?array $OwningAgencyLocationID=null,

        /** @description Coupon code group ("ALL OPEN") or any Coupon Status eg USED, OPEN */
        // @DataMember
        /** @var string */
        public string $CouponCodeGroup='',

        /** @description Date range type. A single character: I = Issue date, T = Travel date, E = Expiry date */
        // @DataMember
        /** @var string */
        public string $DateTracker='',

        /** @description Repeat */
        // @DataMember
        /** @var bool|null */
        public ?bool $Repeat=null,

        /** @description Lists only segments that are not active */
        // @DataMember
        /** @var bool|null */
        public ?bool $NoActiveSegments=null,

        /** @description Include partial matches */
        // @DataMember
        /** @var bool|null */
        public ?bool $IncludePartialMatches=null,

        /** @description Show Matching Coupons Only */
        // @DataMember
        /** @var bool|null */
        public ?bool $ShowMatchingCouponsOnly=null,

        /** @description Pax surname */
        // @DataMember
        /** @var string|null */
        public ?string $PaxSurname=null,

        /** @description Two letter code for carrier */
        // @DataMember
        /** @var string|null */
        public ?string $CarrierCode=null,

        /** @description Comma delimited list of 3-character plating carriers */
        // @DataMember
        /** @var string[]|null */
        public ?array $ExcludedPlatingCarrier=null,

        /** @description Id of the owning consultant */
        // @DataMember
        /** @var string|null */
        public ?string $OwningConsultantID=null,

        /** @description Cache Guid */
        // @DataMember
        /** @var string|null */
        public ?string $CacheGuid=null,

        /** @description Agentivity Traveller GUID */
        // @DataMember
        /** @var string|null */
        public ?string $TravellerGUID=null,

        /** @description Request Consultant ID (sign on) */
        // @DataMember
        /** @var string|null */
        public ?string $RequestConsultantID=null,

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

        // @DataMember
        /** @var string|null */
        public ?string $CRMID=null
    ) {
        parent::__construct($Offset,$Limit,$TotalRecords,$ResponseRecords,$OwningCompanyCode,$UserName);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['DateStart'])) $this->DateStart = $o['DateStart'];
        if (isset($o['DateEnd'])) $this->DateEnd = $o['DateEnd'];
        if (isset($o['TravAgntID'])) $this->TravAgntID = $o['TravAgntID'];
        if (isset($o['Account'])) $this->Account = JsonConverters::fromArray('string', $o['Account']);
        if (isset($o['OwningAgencyLocationID'])) $this->OwningAgencyLocationID = JsonConverters::fromArray('string', $o['OwningAgencyLocationID']);
        if (isset($o['CouponCodeGroup'])) $this->CouponCodeGroup = $o['CouponCodeGroup'];
        if (isset($o['DateTracker'])) $this->DateTracker = $o['DateTracker'];
        if (isset($o['Repeat'])) $this->Repeat = $o['Repeat'];
        if (isset($o['NoActiveSegments'])) $this->NoActiveSegments = $o['NoActiveSegments'];
        if (isset($o['IncludePartialMatches'])) $this->IncludePartialMatches = $o['IncludePartialMatches'];
        if (isset($o['ShowMatchingCouponsOnly'])) $this->ShowMatchingCouponsOnly = $o['ShowMatchingCouponsOnly'];
        if (isset($o['PaxSurname'])) $this->PaxSurname = $o['PaxSurname'];
        if (isset($o['CarrierCode'])) $this->CarrierCode = $o['CarrierCode'];
        if (isset($o['ExcludedPlatingCarrier'])) $this->ExcludedPlatingCarrier = JsonConverters::fromArray('string', $o['ExcludedPlatingCarrier']);
        if (isset($o['OwningConsultantID'])) $this->OwningConsultantID = $o['OwningConsultantID'];
        if (isset($o['CacheGuid'])) $this->CacheGuid = $o['CacheGuid'];
        if (isset($o['TravellerGUID'])) $this->TravellerGUID = $o['TravellerGUID'];
        if (isset($o['RequestConsultantID'])) $this->RequestConsultantID = $o['RequestConsultantID'];
        if (isset($o['CRMCode'])) $this->CRMCode = $o['CRMCode'];
        if (isset($o['CRMID'])) $this->CRMID = $o['CRMID'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->DateStart)) $o['DateStart'] = $this->DateStart;
        if (isset($this->DateEnd)) $o['DateEnd'] = $this->DateEnd;
        if (isset($this->TravAgntID)) $o['TravAgntID'] = $this->TravAgntID;
        if (isset($this->Account)) $o['Account'] = JsonConverters::toArray('string', $this->Account);
        if (isset($this->OwningAgencyLocationID)) $o['OwningAgencyLocationID'] = JsonConverters::toArray('string', $this->OwningAgencyLocationID);
        if (isset($this->CouponCodeGroup)) $o['CouponCodeGroup'] = $this->CouponCodeGroup;
        if (isset($this->DateTracker)) $o['DateTracker'] = $this->DateTracker;
        if (isset($this->Repeat)) $o['Repeat'] = $this->Repeat;
        if (isset($this->NoActiveSegments)) $o['NoActiveSegments'] = $this->NoActiveSegments;
        if (isset($this->IncludePartialMatches)) $o['IncludePartialMatches'] = $this->IncludePartialMatches;
        if (isset($this->ShowMatchingCouponsOnly)) $o['ShowMatchingCouponsOnly'] = $this->ShowMatchingCouponsOnly;
        if (isset($this->PaxSurname)) $o['PaxSurname'] = $this->PaxSurname;
        if (isset($this->CarrierCode)) $o['CarrierCode'] = $this->CarrierCode;
        if (isset($this->ExcludedPlatingCarrier)) $o['ExcludedPlatingCarrier'] = JsonConverters::toArray('string', $this->ExcludedPlatingCarrier);
        if (isset($this->OwningConsultantID)) $o['OwningConsultantID'] = $this->OwningConsultantID;
        if (isset($this->CacheGuid)) $o['CacheGuid'] = $this->CacheGuid;
        if (isset($this->TravellerGUID)) $o['TravellerGUID'] = $this->TravellerGUID;
        if (isset($this->RequestConsultantID)) $o['RequestConsultantID'] = $this->RequestConsultantID;
        if (isset($this->CRMCode)) $o['CRMCode'] = $this->CRMCode;
        if (isset($this->CRMID)) $o['CRMID'] = $this->CRMID;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetTicketCouponsByStatusCode DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

GET /TicketCouponsByStatusCode HTTP/1.1 
Host: api.agentivity.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
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":[{"CompanyName":"String","TktNumber":"String","RN":"String","AirTktSegId":"String","VndIssueDt":"\/Date(-62135596800000-0000)\/","RecordLocator":"String","Passenger":"String","TravAgntID":"String","OwningConsultantID":"String","FOPFare":"String","BaseFare":"String","FOP":"String","TotalTax":"String","Tax1Code":"String","Tax1Amt":"String","Tax2Code":"String","Tax2Amt":"String","Tax3Code":"String","Tax3Amt":"String","Tax4Code":"String","Tax4Amt":"String","Tax5Code":"String","Tax5Amt":"String","Account":"String","ExchangedForTicket":"String","CouponSequenceNbr":"String","Carrier":"String","BoardPoint":"String","OffPoint":"String","FlightDate":"\/Date(-62135596800000-0000)\/","FlightServiceClass":"String","FareBasis":"String","FlightCouponStatus":"String","DateLastChecked":"\/Date(-62135596800000-0000)\/","PCC":"String","AirlineCode":"String","OwningCompanyCode":"String","CreditCurrency":"String","CreditValue":0,"FlightServiceClassName":"String","FlownKM":0,"BAR":"String","PNRCreationDate":"\/Date(-62135596800000-0000)\/","AgentivityRef":0,"CustomFields":[{"FieldName":"String","FieldValue":"String"}]}],"ResponseError":{"ErrorCode":"String","Message":"String","StatusCode":"String","VerboseMessage":"String"}}