Agentivity API

<back to all web services

AgencyReviews

The following routes are available for this service:
GET/AgencyReviews
<?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="AgencyReviewSummary", Namespace="schemas.agentivity.com/types")
class AgencyReviewSummary implements ICarbonTonnage, ICarbonEmissionDto, JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var int */
        public int $TicketedBookings=0,

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

        // @DataMember(Order=25)
        /** @var int */
        public int $AssumedTicketedBookings=0,

        // @DataMember(Order=30)
        /** @var int */
        public int $NonTicketedBookings=0,

        // @DataMember(Order=40)
        /** @var int */
        public int $TicketedBookingsPerc=0,

        // @DataMember(Order=50)
        /** @var int */
        public int $NonTicketedBookingsPerc=0,

        // @DataMember(Order=60)
        /** @var int */
        public int $OnlineBookings=0,

        // @DataMember(Order=70)
        /** @var int */
        public int $OfflineBookings=0,

        // @DataMember(Order=80)
        /** @var int */
        public int $CxlBookings=0,

        // @DataMember(Order=90)
        /** @var int */
        public int $OffLineHtlBookings=0,

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

        // @DataMember(Order=110)
        /** @var int */
        public int $BookingsWithCarSegments=0,

        // @DataMember(Order=120)
        /** @var int */
        public int $NonAirBookings=0,

        // @DataMember(Order=130)
        /** @var int */
        public int $TotalBookings=0,

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

        // @DataMember(Order=145)
        /** @var int */
        public int $AeroTouchesAuto=0,

        // @DataMember(Order=150)
        /** @var float */
        public float $AverageItineraryChanges=0.0,

        // @DataMember(Order=160)
        /** @var float */
        public float $AverageAccountBookingToTravelTime=0.0,

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

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

        // @DataMember(Order=190)
        /** @var float */
        public float $TotalItineraryChanges=0.0,

        // @DataMember(Order=230)
        /** @var int */
        public int $BookingsWithNdcContent=0,

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

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

        // @DataMember(Order=200)
        /** @var float|null */
        public ?float $CarbonTonnage=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['TicketedBookings'])) $this->TicketedBookings = $o['TicketedBookings'];
        if (isset($o['LCCTktBookings'])) $this->LCCTktBookings = $o['LCCTktBookings'];
        if (isset($o['AssumedTicketedBookings'])) $this->AssumedTicketedBookings = $o['AssumedTicketedBookings'];
        if (isset($o['NonTicketedBookings'])) $this->NonTicketedBookings = $o['NonTicketedBookings'];
        if (isset($o['TicketedBookingsPerc'])) $this->TicketedBookingsPerc = $o['TicketedBookingsPerc'];
        if (isset($o['NonTicketedBookingsPerc'])) $this->NonTicketedBookingsPerc = $o['NonTicketedBookingsPerc'];
        if (isset($o['OnlineBookings'])) $this->OnlineBookings = $o['OnlineBookings'];
        if (isset($o['OfflineBookings'])) $this->OfflineBookings = $o['OfflineBookings'];
        if (isset($o['CxlBookings'])) $this->CxlBookings = $o['CxlBookings'];
        if (isset($o['OffLineHtlBookings'])) $this->OffLineHtlBookings = $o['OffLineHtlBookings'];
        if (isset($o['BookingsWithHotelSegments'])) $this->BookingsWithHotelSegments = $o['BookingsWithHotelSegments'];
        if (isset($o['BookingsWithCarSegments'])) $this->BookingsWithCarSegments = $o['BookingsWithCarSegments'];
        if (isset($o['NonAirBookings'])) $this->NonAirBookings = $o['NonAirBookings'];
        if (isset($o['TotalBookings'])) $this->TotalBookings = $o['TotalBookings'];
        if (isset($o['AeroTouches'])) $this->AeroTouches = $o['AeroTouches'];
        if (isset($o['AeroTouchesAuto'])) $this->AeroTouchesAuto = $o['AeroTouchesAuto'];
        if (isset($o['AverageItineraryChanges'])) $this->AverageItineraryChanges = $o['AverageItineraryChanges'];
        if (isset($o['AverageAccountBookingToTravelTime'])) $this->AverageAccountBookingToTravelTime = $o['AverageAccountBookingToTravelTime'];
        if (isset($o['TotalItineraryChangesBeforeTicketing'])) $this->TotalItineraryChangesBeforeTicketing = $o['TotalItineraryChangesBeforeTicketing'];
        if (isset($o['TotalItineraryChangesAfterTicketing'])) $this->TotalItineraryChangesAfterTicketing = $o['TotalItineraryChangesAfterTicketing'];
        if (isset($o['TotalItineraryChanges'])) $this->TotalItineraryChanges = $o['TotalItineraryChanges'];
        if (isset($o['BookingsWithNdcContent'])) $this->BookingsWithNdcContent = $o['BookingsWithNdcContent'];
        if (isset($o['CarbonEmissionValue'])) $this->CarbonEmissionValue = $o['CarbonEmissionValue'];
        if (isset($o['CarbonEmissionUnitId'])) $this->CarbonEmissionUnitId = $o['CarbonEmissionUnitId'];
        if (isset($o['CarbonTonnage'])) $this->CarbonTonnage = $o['CarbonTonnage'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->TicketedBookings)) $o['TicketedBookings'] = $this->TicketedBookings;
        if (isset($this->LCCTktBookings)) $o['LCCTktBookings'] = $this->LCCTktBookings;
        if (isset($this->AssumedTicketedBookings)) $o['AssumedTicketedBookings'] = $this->AssumedTicketedBookings;
        if (isset($this->NonTicketedBookings)) $o['NonTicketedBookings'] = $this->NonTicketedBookings;
        if (isset($this->TicketedBookingsPerc)) $o['TicketedBookingsPerc'] = $this->TicketedBookingsPerc;
        if (isset($this->NonTicketedBookingsPerc)) $o['NonTicketedBookingsPerc'] = $this->NonTicketedBookingsPerc;
        if (isset($this->OnlineBookings)) $o['OnlineBookings'] = $this->OnlineBookings;
        if (isset($this->OfflineBookings)) $o['OfflineBookings'] = $this->OfflineBookings;
        if (isset($this->CxlBookings)) $o['CxlBookings'] = $this->CxlBookings;
        if (isset($this->OffLineHtlBookings)) $o['OffLineHtlBookings'] = $this->OffLineHtlBookings;
        if (isset($this->BookingsWithHotelSegments)) $o['BookingsWithHotelSegments'] = $this->BookingsWithHotelSegments;
        if (isset($this->BookingsWithCarSegments)) $o['BookingsWithCarSegments'] = $this->BookingsWithCarSegments;
        if (isset($this->NonAirBookings)) $o['NonAirBookings'] = $this->NonAirBookings;
        if (isset($this->TotalBookings)) $o['TotalBookings'] = $this->TotalBookings;
        if (isset($this->AeroTouches)) $o['AeroTouches'] = $this->AeroTouches;
        if (isset($this->AeroTouchesAuto)) $o['AeroTouchesAuto'] = $this->AeroTouchesAuto;
        if (isset($this->AverageItineraryChanges)) $o['AverageItineraryChanges'] = $this->AverageItineraryChanges;
        if (isset($this->AverageAccountBookingToTravelTime)) $o['AverageAccountBookingToTravelTime'] = $this->AverageAccountBookingToTravelTime;
        if (isset($this->TotalItineraryChangesBeforeTicketing)) $o['TotalItineraryChangesBeforeTicketing'] = $this->TotalItineraryChangesBeforeTicketing;
        if (isset($this->TotalItineraryChangesAfterTicketing)) $o['TotalItineraryChangesAfterTicketing'] = $this->TotalItineraryChangesAfterTicketing;
        if (isset($this->TotalItineraryChanges)) $o['TotalItineraryChanges'] = $this->TotalItineraryChanges;
        if (isset($this->BookingsWithNdcContent)) $o['BookingsWithNdcContent'] = $this->BookingsWithNdcContent;
        if (isset($this->CarbonEmissionValue)) $o['CarbonEmissionValue'] = $this->CarbonEmissionValue;
        if (isset($this->CarbonEmissionUnitId)) $o['CarbonEmissionUnitId'] = $this->CarbonEmissionUnitId;
        if (isset($this->CarbonTonnage)) $o['CarbonTonnage'] = $this->CarbonTonnage;
        return empty($o) ? new class(){} : $o;
    }
}

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

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

        // @DataMember(Order=30)
        /** @var int */
        public int $TotalSegments=0
    ) {
    }

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

// @DataContract(Name="AirlineSupport", Namespace="schemas.agentivity.com/types")
class AirlineSupport implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var array<AirlineStats>|null */
        public ?array $AirlinesStats=null,

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

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

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

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

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

        // @DataMember(Order=30)
        /** @var int */
        public int $TotalSegments=0
    ) {
    }

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

// @DataContract(Name="CarSupport", Namespace="schemas.agentivity.com/types")
class CarSupport implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var array<CarStats>|null */
        public ?array $Stats=null,

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

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

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

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

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

        // @DataMember(Order=30)
        /** @var int */
        public int $TotalSegments=0,

        // @DataMember(Order=40)
        /** @var int */
        public int $TotalNights=0
    ) {
    }

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

// @DataContract(Name="HotelSupport", Namespace="schemas.agentivity.com/types")
class HotelSupport implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=10)
        /** @var array<HotelStats>|null */
        public ?array $Stats=null,

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

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

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

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

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

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

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

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

// @Flags()
enum AgencyReviewOptions : int
{
    case None = 0;
    case Summary = 1;
    case AirlineSupport = 2;
    case SummaryAirlineSupport = 3;
    case CarSupport = 4;
    case HotelSupport = 8;
    case All = 15;
}

// @Flags()
enum FormattingStyle : int
{
    case None = 0;
    case Html = 1;
    case Charting = 2;
}

// @Flags()
enum AgencyReviewMode : int
{
    case Account = 0;
    case Pcc = 1;
}

// @DataContract(Namespace="schemas.agentivity.com/types")
class AgencyReviews 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 Account */
        // @DataMember
        /** @var string|null */
        public ?string $Account=null,

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

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

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

        /** @description Load options */
        // @DataMember
        /** @var AgencyReviewOptions|null */
        public ?AgencyReviewOptions $LoadOptions=null,

        /** @description Airline support format style */
        // @DataMember
        /** @var FormattingStyle|null */
        public ?FormattingStyle $AirlineSupportFormatStyle=null,

        /** @description Car support format style */
        // @DataMember
        /** @var FormattingStyle|null */
        public ?FormattingStyle $CarSupportFormatStyle=null,

        /** @description Hotel support format style */
        // @DataMember
        /** @var FormattingStyle|null */
        public ?FormattingStyle $HotelSupportFormatStyle=null,

        /** @description Excluded carrier code */
        // @DataMember
        /** @var string|null */
        public ?string $ExcludedCarrierCode=null,

        /** @description Mode */
        // @DataMember
        /** @var AgencyReviewMode|null */
        public ?AgencyReviewMode $Mode=null,

        /** @description Top car items */
        // @DataMember
        /** @var int|null */
        public ?int $TopCarItems=null,

        /** @description Top hotel items */
        // @DataMember
        /** @var int|null */
        public ?int $TopHotelItems=null,

        /** @description Includes AfterHours Servicing in results */
        // @DataMember
        /** @var bool|null */
        public ?bool $IncludeAfterHoursServicingFields=null,

        /** @description Request Consultant ID (sign on) */
        // @DataMember
        /** @var string|null */
        public ?string $RequestConsultantID=null
    ) {
        parent::__construct($Offset,$Limit,$TotalRecords,$ResponseRecords,$OwningCompanyCode,$UserName);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Account'])) $this->Account = $o['Account'];
        if (isset($o['PNRCreationDateStart'])) $this->PNRCreationDateStart = $o['PNRCreationDateStart'];
        if (isset($o['PNRCreationDateEnd'])) $this->PNRCreationDateEnd = $o['PNRCreationDateEnd'];
        if (isset($o['OwningAgencyLocationID'])) $this->OwningAgencyLocationID = JsonConverters::fromArray('string', $o['OwningAgencyLocationID']);
        if (isset($o['LoadOptions'])) $this->LoadOptions = JsonConverters::from('AgencyReviewOptions', $o['LoadOptions']);
        if (isset($o['AirlineSupportFormatStyle'])) $this->AirlineSupportFormatStyle = JsonConverters::from('FormattingStyle', $o['AirlineSupportFormatStyle']);
        if (isset($o['CarSupportFormatStyle'])) $this->CarSupportFormatStyle = JsonConverters::from('FormattingStyle', $o['CarSupportFormatStyle']);
        if (isset($o['HotelSupportFormatStyle'])) $this->HotelSupportFormatStyle = JsonConverters::from('FormattingStyle', $o['HotelSupportFormatStyle']);
        if (isset($o['ExcludedCarrierCode'])) $this->ExcludedCarrierCode = $o['ExcludedCarrierCode'];
        if (isset($o['Mode'])) $this->Mode = JsonConverters::from('AgencyReviewMode', $o['Mode']);
        if (isset($o['TopCarItems'])) $this->TopCarItems = $o['TopCarItems'];
        if (isset($o['TopHotelItems'])) $this->TopHotelItems = $o['TopHotelItems'];
        if (isset($o['IncludeAfterHoursServicingFields'])) $this->IncludeAfterHoursServicingFields = $o['IncludeAfterHoursServicingFields'];
        if (isset($o['RequestConsultantID'])) $this->RequestConsultantID = $o['RequestConsultantID'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Account)) $o['Account'] = $this->Account;
        if (isset($this->PNRCreationDateStart)) $o['PNRCreationDateStart'] = $this->PNRCreationDateStart;
        if (isset($this->PNRCreationDateEnd)) $o['PNRCreationDateEnd'] = $this->PNRCreationDateEnd;
        if (isset($this->OwningAgencyLocationID)) $o['OwningAgencyLocationID'] = JsonConverters::toArray('string', $this->OwningAgencyLocationID);
        if (isset($this->LoadOptions)) $o['LoadOptions'] = JsonConverters::to('AgencyReviewOptions', $this->LoadOptions);
        if (isset($this->AirlineSupportFormatStyle)) $o['AirlineSupportFormatStyle'] = JsonConverters::to('FormattingStyle', $this->AirlineSupportFormatStyle);
        if (isset($this->CarSupportFormatStyle)) $o['CarSupportFormatStyle'] = JsonConverters::to('FormattingStyle', $this->CarSupportFormatStyle);
        if (isset($this->HotelSupportFormatStyle)) $o['HotelSupportFormatStyle'] = JsonConverters::to('FormattingStyle', $this->HotelSupportFormatStyle);
        if (isset($this->ExcludedCarrierCode)) $o['ExcludedCarrierCode'] = $this->ExcludedCarrierCode;
        if (isset($this->Mode)) $o['Mode'] = JsonConverters::to('AgencyReviewMode', $this->Mode);
        if (isset($this->TopCarItems)) $o['TopCarItems'] = $this->TopCarItems;
        if (isset($this->TopHotelItems)) $o['TopHotelItems'] = $this->TopHotelItems;
        if (isset($this->IncludeAfterHoursServicingFields)) $o['IncludeAfterHoursServicingFields'] = $this->IncludeAfterHoursServicingFields;
        if (isset($this->RequestConsultantID)) $o['RequestConsultantID'] = $this->RequestConsultantID;
        return empty($o) ? new class(){} : $o;
    }
}

PHP AgencyReviews 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 /AgencyReviews HTTP/1.1 
Host: api.agentivity.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"ResponseMetadata":{"Success":false,"HasCache":false,"HasPaging":false,"CacheMetadata":{"IsFromCache":false,"CachedAt":"\/Date(-62135596800000-0000)\/","CacheExpiresAt":"\/Date(-62135596800000-0000)\/"},"PagingMetadata":{"Offset":"String","Limit":"String","TotalRecords":0,"ResponseRecords":0}},"ResponseReport":[{"Summary":{"TicketedBookings":0,"LCCTktBookings":0,"AssumedTicketedBookings":0,"NonTicketedBookings":0,"TicketedBookingsPerc":0,"NonTicketedBookingsPerc":0,"OnlineBookings":0,"OfflineBookings":0,"CxlBookings":0,"OffLineHtlBookings":0,"BookingsWithHotelSegments":0,"BookingsWithCarSegments":0,"NonAirBookings":0,"TotalBookings":0,"AeroTouches":0,"AeroTouchesAuto":0,"AverageItineraryChanges":0,"AverageAccountBookingToTravelTime":0,"TotalItineraryChangesBeforeTicketing":0,"TotalItineraryChangesAfterTicketing":0,"TotalItineraryChanges":0,"CarbonTonnage":0,"CarbonEmissionValue":0,"CarbonEmissionUnitId":0,"BookingsWithNdcContent":0},"AirlineSupport":{"AirlinesStats":[{"CarrierCode":"String","Carrier":"String","TotalSegments":0}],"TotalSegments":0,"FormattedAirlineSupport":"String"},"CarSupport":{"Stats":[{"VendorCode":"String","VendorName":"String","TotalSegments":0}],"TotalSegments":0,"FormattedCarSupport":"String"},"HotelSupport":{"Stats":[{"VendorCode":"String","VendorName":"String","TotalSegments":0,"TotalNights":0}],"TotalSegments":0,"FormattedHotelSupport":"String"}}],"ResponseError":{"ErrorCode":"String","Message":"String","StatusCode":"String","VerboseMessage":"String"}}