Agentivity API

<back to all web services

GetItineraryChangeEvents

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AgentivityRef'])) $this->AgentivityRef = $o['AgentivityRef'];
        if (isset($o['RecordLocator'])) $this->RecordLocator = $o['RecordLocator'];
        if (isset($o['LastActionConsultant'])) $this->LastActionConsultant = $o['LastActionConsultant'];
        if (isset($o['Passengers'])) $this->Passengers = $o['Passengers'];
        if (isset($o['EventDateTime'])) $this->EventDateTime = JsonConverters::from('DateTime', $o['EventDateTime']);
        if (isset($o['EventDateTimeFormatted'])) $this->EventDateTimeFormatted = $o['EventDateTimeFormatted'];
        if (isset($o['EventTypeDetail'])) $this->EventTypeDetail = $o['EventTypeDetail'];
        if (isset($o['EventTypeGroup'])) $this->EventTypeGroup = $o['EventTypeGroup'];
        if (isset($o['OldData'])) $this->OldData = $o['OldData'];
        if (isset($o['NewData'])) $this->NewData = $o['NewData'];
        if (isset($o['PNRTicketed'])) $this->PNRTicketed = $o['PNRTicketed'];
        if (isset($o['FirstDILine'])) $this->FirstDILine = $o['FirstDILine'];
        if (isset($o['Account'])) $this->Account = $o['Account'];
        if (isset($o['PurchaseOrder'])) $this->PurchaseOrder = $o['PurchaseOrder'];
        if (isset($o['DivisionCode'])) $this->DivisionCode = $o['DivisionCode'];
        if (isset($o['BusinessUnit'])) $this->BusinessUnit = $o['BusinessUnit'];
        if (isset($o['AccountCode'])) $this->AccountCode = $o['AccountCode'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->AgentivityRef)) $o['AgentivityRef'] = $this->AgentivityRef;
        if (isset($this->RecordLocator)) $o['RecordLocator'] = $this->RecordLocator;
        if (isset($this->LastActionConsultant)) $o['LastActionConsultant'] = $this->LastActionConsultant;
        if (isset($this->Passengers)) $o['Passengers'] = $this->Passengers;
        if (isset($this->EventDateTime)) $o['EventDateTime'] = JsonConverters::to('DateTime', $this->EventDateTime);
        if (isset($this->EventDateTimeFormatted)) $o['EventDateTimeFormatted'] = $this->EventDateTimeFormatted;
        if (isset($this->EventTypeDetail)) $o['EventTypeDetail'] = $this->EventTypeDetail;
        if (isset($this->EventTypeGroup)) $o['EventTypeGroup'] = $this->EventTypeGroup;
        if (isset($this->OldData)) $o['OldData'] = $this->OldData;
        if (isset($this->NewData)) $o['NewData'] = $this->NewData;
        if (isset($this->PNRTicketed)) $o['PNRTicketed'] = $this->PNRTicketed;
        if (isset($this->FirstDILine)) $o['FirstDILine'] = $this->FirstDILine;
        if (isset($this->Account)) $o['Account'] = $this->Account;
        if (isset($this->PurchaseOrder)) $o['PurchaseOrder'] = $this->PurchaseOrder;
        if (isset($this->DivisionCode)) $o['DivisionCode'] = $this->DivisionCode;
        if (isset($this->BusinessUnit)) $o['BusinessUnit'] = $this->BusinessUnit;
        if (isset($this->AccountCode)) $o['AccountCode'] = $this->AccountCode;
        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="ItineraryChangeEvent", Namespace="schemas.agentivity.com/types")
/**
 * @template Report2 of ItineraryChangeEventsItemResponse
 * @template Report21 of ItineraryChangeEvent
 */
class ItineraryChangeEventsResponseReport 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 ItineraryChangeEvent
 * @template ItemResponse21 of ItineraryChangeEventsResponseReport
 */
class ItineraryChangeEventsItemResponse 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 GetItineraryChangeEvents 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 Comma Delimited List of Accounts */
        // @DataMember
        /** @var string[]|null */
        public ?array $Account=null,

        /** @description UserName in form of an email address */
        // @DataMember
        /** @var string */
        public string $UserName='',

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

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

        /** @description Return only PNRs that are ticketed/all */
        // @DataMember
        /** @var string|null */
        public ?string $PNRTicketed=null,

        /** @description Add document information line  */
        // @DataMember
        /** @var bool|null */
        public ?bool $AddDILine=null,

        /** @description Comma Delimited List of Event Type Details. Valid values are: AirBkgCodeChanged, AirRouteChanged, AirStatusChanged, AirSupplierChanged, AirTimingsChanged, CarDatesTimingsChanged, CarLocationChanged, CarStatusChanged, CarSupplierChanged, CarTypeCodeChanged, FewerAirSegs, FewerCar_PSegs, FewerCarSegs, FewerHtl_PSegs, FewerHtlSegs, FewerTrn_PSegs, FlightNbrChanged, Htl_PChainChanged, Htl_PDatesChanged, Htl_PLocationChanged, Htl_PTextChanged, HtlChainChanged, HtlDatesChanged, HtlLocationChanged, HtlPropertyChanged, HtlRateCodeChanged, HtlRoomCodeChanged, HtlStatusChanged, MoreAirSegs, MoreCar_PSegs, MoreCarSegs, MoreHtl_PSegs, MoreHtlSegs, MoreTrn_PSegs, TrainDatesChanged */
        // @DataMember
        /** @var string[]|null */
        public ?array $EventTypeDetail=null
    ) {
        parent::__construct($Offset,$Limit,$TotalRecords,$ResponseRecords);
    }

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

PHP GetItineraryChangeEvents 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 /ItineraryChangeEvents 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":{"AgentivityRef":"String","RecordLocator":"String","LastActionConsultant":"String","Passengers":"String","EventDateTime":"\/Date(-62135596800000-0000)\/","EventDateTimeFormatted":"String","EventTypeDetail":"String","EventTypeGroup":"String","OldData":"String","NewData":"String","PNRTicketed":"String","FirstDILine":"String","Account":"String","PurchaseOrder":"String","DivisionCode":"String","BusinessUnit":"String","AccountCode":"String"}},"ResponseError":{"ErrorCode":"String","Message":"String","StatusCode":"String","VerboseMessage":"String"}}