Agentivity API

<back to all web services

GetTravellersByCrm

The following routes are available for this service:
All Verbs/TravellersByCRM
<?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="AliasesItem", Namespace="schemas.agentivity.com/types")
class Aliases implements JsonSerializable
{
    public function __construct(
        // @DataMember
        /** @var string|null */
        public ?string $FirstName=null,

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        // @DataMember(Order=70)
        /** @var array<Aliases>|null */
        public ?array $Aliases=null,

        // @DataMember(Order=80)
        /** @var array<Accounts>|null */
        public ?array $Accounts=null,

        // @DataMember(Order=90)
        /** @var array<BARS>|null */
        public ?array $BARS=null,

        // @DataMember(Order=100)
        /** @var array<MARS>|null */
        public ?array $MARS=null,

        // @DataMember(Order=110)
        /** @var array<PARS>|null */
        public ?array $PARS=null,

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

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['TravellerGUID'])) $this->TravellerGUID = $o['TravellerGUID'];
        if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
        if (isset($o['LastName'])) $this->LastName = $o['LastName'];
        if (isset($o['BAR'])) $this->BAR = $o['BAR'];
        if (isset($o['MAR'])) $this->MAR = $o['MAR'];
        if (isset($o['PAR'])) $this->PAR = $o['PAR'];
        if (isset($o['Aliases'])) $this->Aliases = JsonConverters::fromArray('Aliases', $o['Aliases']);
        if (isset($o['Accounts'])) $this->Accounts = JsonConverters::fromArray('Accounts', $o['Accounts']);
        if (isset($o['BARS'])) $this->BARS = JsonConverters::fromArray('BARS', $o['BARS']);
        if (isset($o['MARS'])) $this->MARS = JsonConverters::fromArray('MARS', $o['MARS']);
        if (isset($o['PARS'])) $this->PARS = JsonConverters::fromArray('PARS', $o['PARS']);
        if (isset($o['PNRStats'])) $this->PNRStats = JsonConverters::from('PNRStats', $o['PNRStats']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->TravellerGUID)) $o['TravellerGUID'] = $this->TravellerGUID;
        if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
        if (isset($this->LastName)) $o['LastName'] = $this->LastName;
        if (isset($this->BAR)) $o['BAR'] = $this->BAR;
        if (isset($this->MAR)) $o['MAR'] = $this->MAR;
        if (isset($this->PAR)) $o['PAR'] = $this->PAR;
        if (isset($this->Aliases)) $o['Aliases'] = JsonConverters::toArray('Aliases', $this->Aliases);
        if (isset($this->Accounts)) $o['Accounts'] = JsonConverters::toArray('Accounts', $this->Accounts);
        if (isset($this->BARS)) $o['BARS'] = JsonConverters::toArray('BARS', $this->BARS);
        if (isset($this->MARS)) $o['MARS'] = JsonConverters::toArray('MARS', $this->MARS);
        if (isset($this->PARS)) $o['PARS'] = JsonConverters::toArray('PARS', $this->PARS);
        if (isset($this->PNRStats)) $o['PNRStats'] = JsonConverters::to('PNRStats', $this->PNRStats);
        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="TicketsIssuedByNumber", Namespace="schemas.agentivity.com/types")
class TicketsIssuedByNumber implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var string|null */
        public ?string $RecordLocator=null,

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

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

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

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

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

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

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

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

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

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

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

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['RecordLocator'])) $this->RecordLocator = $o['RecordLocator'];
        if (isset($o['TktNumber'])) $this->TktNumber = $o['TktNumber'];
        if (isset($o['PlatingCarrier'])) $this->PlatingCarrier = $o['PlatingCarrier'];
        if (isset($o['Passenger'])) $this->Passenger = $o['Passenger'];
        if (isset($o['IATA'])) $this->IATA = $o['IATA'];
        if (isset($o['OwningAgencyLocationID'])) $this->OwningAgencyLocationID = $o['OwningAgencyLocationID'];
        if (isset($o['IssueDate'])) $this->IssueDate = JsonConverters::from('DateTime', $o['IssueDate']);
        if (isset($o['ExpirationDate'])) $this->ExpirationDate = JsonConverters::from('DateTime', $o['ExpirationDate']);
        if (isset($o['FOPFare'])) $this->FOPFare = $o['FOPFare'];
        if (isset($o['PrintedCurrency'])) $this->PrintedCurrency = $o['PrintedCurrency'];
        if (isset($o['TicketingAgentID'])) $this->TicketingAgentID = $o['TicketingAgentID'];
        if (isset($o['TicketingAgent'])) $this->TicketingAgent = $o['TicketingAgent'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->RecordLocator)) $o['RecordLocator'] = $this->RecordLocator;
        if (isset($this->TktNumber)) $o['TktNumber'] = $this->TktNumber;
        if (isset($this->PlatingCarrier)) $o['PlatingCarrier'] = $this->PlatingCarrier;
        if (isset($this->Passenger)) $o['Passenger'] = $this->Passenger;
        if (isset($this->IATA)) $o['IATA'] = $this->IATA;
        if (isset($this->OwningAgencyLocationID)) $o['OwningAgencyLocationID'] = $this->OwningAgencyLocationID;
        if (isset($this->IssueDate)) $o['IssueDate'] = JsonConverters::to('DateTime', $this->IssueDate);
        if (isset($this->ExpirationDate)) $o['ExpirationDate'] = JsonConverters::to('DateTime', $this->ExpirationDate);
        if (isset($this->FOPFare)) $o['FOPFare'] = $this->FOPFare;
        if (isset($this->PrintedCurrency)) $o['PrintedCurrency'] = $this->PrintedCurrency;
        if (isset($this->TicketingAgentID)) $o['TicketingAgentID'] = $this->TicketingAgentID;
        if (isset($this->TicketingAgent)) $o['TicketingAgent'] = $this->TicketingAgent;
        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<TicketsIssuedByNumber>|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('TicketsIssuedByNumber', $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('TicketsIssuedByNumber', $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 TravellerByNameNested
 */
class TravellersByCrmResponse extends CollectionResponse implements JsonSerializable
{
    /**
     * @param ResponseMetadata|null $ResponseMetadata
     * @param array<TicketsIssuedByNumber>|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 GetTravellersByCrm extends CompanyLevelRequestBase implements 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,
        // @DataMember
        /** @var int */
        public int $CrmCode=0,

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

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

PHP GetTravellersByCrm DTOs

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

HTTP + XML

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

POST /TravellersByCRM HTTP/1.1 
Host: api.agentivity.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<GetTravellersByCrm xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="schemas.agentivity.com/types">
  <Limit>String</Limit>
  <Offset>String</Offset>
  <ResponseRecords>0</ResponseRecords>
  <TotalRecords>0</TotalRecords>
  <OwningCompanyCode xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </OwningCompanyCode>
  <UserName>String</UserName>
  <CrmCode>0</CrmCode>
  <CrmTravellerId>String</CrmTravellerId>
</GetTravellersByCrm>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<AgentivityResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="schemas.agentivity.com/types">
  <ResponseMetadata>
    <Success>false</Success>
    <HasCache>false</HasCache>
    <HasPaging>false</HasPaging>
    <CacheMetadata>
      <IsFromCache>false</IsFromCache>
      <CachedAt>0001-01-01T00:00:00</CachedAt>
      <CacheExpiresAt>0001-01-01T00:00:00</CacheExpiresAt>
    </CacheMetadata>
    <PagingMetadata>
      <Limit>String</Limit>
      <Offset>String</Offset>
      <ResponseRecords>0</ResponseRecords>
      <TotalRecords>0</TotalRecords>
    </PagingMetadata>
  </ResponseMetadata>
  <ResponseReport>
    <Traveller>
      <TravellerGUID>String</TravellerGUID>
      <FirstName>String</FirstName>
      <LastName>String</LastName>
      <BAR>String</BAR>
      <MAR>String</MAR>
      <PAR>String</PAR>
      <Aliases>
        <AliasesItem>
          <FirstName>String</FirstName>
          <LastName>String</LastName>
        </AliasesItem>
      </Aliases>
      <Accounts>
        <Account>
          <AccountID>String</AccountID>
          <AccountName>String</AccountName>
          <PNRStats>
            <PNRsCreatedPreviousThreeYears>0</PNRsCreatedPreviousThreeYears>
          </PNRStats>
        </Account>
      </Accounts>
      <BARS>
        <BARItem>
          <BAR>String</BAR>
        </BARItem>
      </BARS>
      <MARS>
        <MARItem>
          <MAR>String</MAR>
        </MARItem>
      </MARS>
      <PARS>
        <PARitem>
          <PAR>String</PAR>
        </PARitem>
      </PARS>
      <PNRStats>
        <PNRsCreatedPreviousThreeYears>0</PNRsCreatedPreviousThreeYears>
      </PNRStats>
    </Traveller>
  </ResponseReport>
  <ResponseError>
    <ErrorCode>String</ErrorCode>
    <Message>String</Message>
    <StatusCode>String</StatusCode>
    <VerboseMessage>String</VerboseMessage>
  </ResponseError>
</AgentivityResponse>