Agentivity API

<back to all web services

GetBookingsCreatedAndSegments

The following routes are available for this service:
All Verbs/BookingsCreatedAndSegments
<?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(Namespace="schemas.agentivity.com/types")
class GetBookingsCreatedAndSegments 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,
        /** @description Comma Delimited List of PCCs */
        // @DataMember
        /** @var string[]|null */
        public ?array $OwningAgencyLocationID=null,

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

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

        /** @description When set to true, filters the results to only include air segments where the associated PNR has been ticketed. Other segments types are unaffected by this filter */
        // @DataMember
        /** @var bool|null */
        public ?bool $AirSegmentsMustBeTicketed=null
    ) {
        parent::__construct($Offset,$Limit,$TotalRecords,$ResponseRecords,$OwningCompanyCode,$UserName);
    }

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

PHP GetBookingsCreatedAndSegments DTOs

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

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

HTTP + JSON

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

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

{"OwningAgencyLocationID":["String"],"PNRCreationDateStart":"String","PNRCreationDateEnd":"String","AirSegmentsMustBeTicketed":false,"OwningCompanyCode":["String"],"UserName":"String","Offset":"String","Limit":"String","TotalRecords":0,"ResponseRecords":0}