Agentivity API

<back to all web services

PNROriginatingCountries

The following routes are available for this service:
All Verbs/PnrOriginatingCountries/Company
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PagingMetadata:
    # @ApiMember(DataType="string", Description="Starting Record", Name="Offset", ParameterType="query")
    offset: Optional[str] = None
    """
    Starting Record
    """


    # @ApiMember(DataType="string", Description="Number of records to return (PageSize)", Name="Limit", ParameterType="query")
    limit: Optional[str] = None
    """
    Number of records to return (PageSize)
    """


    # @ApiMember(DataType="string", Description="Total Number of Records in a Full Reponse (if no paging)", Name="TotalRecords", ParameterType="query")
    total_records: int = 0
    """
    Total Number of Records in a Full Reponse (if no paging)
    """


    # @ApiMember(DataType="string", Description="Total Number of Records in this Reponse (on this page)", Name="ResponseRecords", ParameterType="query")
    response_records: int = 0
    """
    Total Number of Records in this Reponse (on this page)
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PNRSegmentCounts2:
    agentivity_ref: int = 0
    record_locator: Optional[str] = None
    owning_agency_location_i_d: Optional[str] = None
    country_code: Optional[str] = None
    owning_consultant: Optional[str] = None
    account: Optional[str] = None
    pnr_creation_date: Optional[datetime.datetime] = None
    ticketed_date: Optional[datetime.datetime] = None
    pnr_ticketed: Optional[str] = None
    air_seg_count: int = 0
    air_p_seg_count: int = 0
    car_seg_count: int = 0
    car_p_seg_count: int = 0
    htl_seg_count: int = 0
    htl_p_seg_count: int = 0
    other_seg_count: int = 0
    ticket_count: int = 0
    country_count: int = 0
    pax_list: Optional[str] = None
    routing: Optional[str] = None
    tickets: Optional[str] = None
    travel_date: Optional[datetime.datetime] = None
    carriers_names: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CacheMetadata:
    cached_at: datetime.datetime = datetime.datetime(1, 1, 1)
    cache_expires_at: datetime.datetime = datetime.datetime(1, 1, 1)
    is_from_cache: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResponseMetadata:
    success: bool = False
    has_cache: bool = False
    has_paging: bool = False
    cache_metadata: Optional[CacheMetadata] = None
    paging_metadata: Optional[PagingMetadata] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ApiRequestPerHour:
    request_date: datetime.datetime = datetime.datetime(1, 1, 1)
    hour0: int = 0
    hour1: int = 0
    hour2: int = 0
    hour3: int = 0
    hour4: int = 0
    hour5: int = 0
    hour6: int = 0
    hour7: int = 0
    hour8: int = 0
    hour9: int = 0
    hour10: int = 0
    hour11: int = 0
    hour12: int = 0
    hour13: int = 0
    hour14: int = 0
    hour15: int = 0
    hour16: int = 0
    hour17: int = 0
    hour18: int = 0
    hour19: int = 0
    hour20: int = 0
    hour21: int = 0
    hour22: int = 0
    hour23: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AgentivityError:
    error_code: Optional[str] = None
    message: Optional[str] = None
    status_code: Optional[str] = None
    verbose_message: Optional[str] = None


TItem = TypeVar('TItem')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CollectionResponse(Generic[TItem]):
    response_metadata: Optional[ResponseMetadata] = None
    response_report: Optional[List[ApiRequestPerHour]] = None
    response_error: Optional[AgentivityError] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PNRSegmentCountsByCompanyAgentLocation2Response(CollectionResponse[PNRSegmentCounts2]):
    pass


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PNROriginatingCountries(PagingMetadata):
    user_name: Optional[str] = None

Python PNROriginatingCountries DTOs

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

HTTP + CSV

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

POST /PnrOriginatingCountries/Company HTTP/1.1 
Host: api.agentivity.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"UserName":"String","Offset":"String","Limit":"String","TotalRecords":0,"ResponseRecords":0}
HTTP/1.1 200 OK
Content-Type: text/csv
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":[{"AgentivityRef":0,"RecordLocator":"String","OwningAgencyLocationID":"String","CountryCode":"String","OwningConsultant":"String","Account":"String","PNRCreationDate":"\/Date(-62135596800000-0000)\/","TicketedDate":"\/Date(-62135596800000-0000)\/","PNRTicketed":"String","AirSegCount":0,"AirPSegCount":0,"CarSegCount":0,"CarPSegCount":0,"HtlSegCount":0,"HtlPSegCount":0,"OtherSegCount":0,"TicketCount":0,"CountryCount":0,"PaxList":"String","Routing":"String","Tickets":"String","TravelDate":"\/Date(-62135596800000-0000)\/","CarriersNames":"String"}],"ResponseError":{"ErrorCode":"String","Message":"String","StatusCode":"String","VerboseMessage":"String"}}