Agentivity API

<back to all web services

BookingsCountsPerConsultant

The following routes are available for this service:
GET/BookingsCountsPerConsultant
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 CompanyLevelRequestBase(PagingMetadata, IMemberUsername, IMemberOwningCompanyCode):
    owning_company_code: Optional[List[str]] = None
    """
    Comma Delimited List of Owning Company Codes
    """

    user_name: Optional[str] = None
    """
    UserName in form of an email address
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ItinerarySegment:
    segment_type: Optional[str] = None
    segment_nbr: int = 0
    board_point: Optional[str] = None
    off_point: Optional[str] = None
    operator_code: Optional[str] = None
    operator_service: Optional[str] = None
    segment_status: Optional[str] = None
    departure_time_formatted: Optional[str] = None
    arrival_time_formatted: Optional[str] = None
    change_of_day_formatted: Optional[str] = None
    service_code: Optional[str] = None
    start_date: Optional[str] = None
    end_date: Optional[str] = None
    ticket_number: Optional[str] = None
    vendor_locators: Optional[str] = None
    """
    Comma separated list of vendor locators
    """

    equipment_code: Optional[str] = None
    equipment: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ItinerarySegmentsCollection(List[ItinerarySegment]):
    pass


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BookingCountsPerConsultant(IBookingItinerary):
    owning_consultant: Optional[str] = None
    owning_consultant_i_d: Optional[str] = None
    total_bookings: int = 0
    cancelled_count: int = 0
    containing_air_count: int = 0
    gds_ticketed_count: int = 0
    low_cost_carrier_count: int = 0
    assumed_ticketed_count: int = 0
    churn_count: int = 0
    qualifier_count: Optional[int] = None
    country_count: Optional[str] = None
    robotic_ticketing_count: int = 0
    record_locator: Optional[str] = None
    account: Optional[str] = None
    travel_date: Optional[datetime.datetime] = None
    remark: Optional[str] = None
    passangers: Optional[str] = None
    pnr_creation_date: Optional[datetime.datetime] = None
    agent_initials: Optional[str] = None
    agentivity_ref: int = 0
    itinerary: Optional[ItinerarySegmentsCollection] = None
    itinerary_formatted: Optional[str] = None


TItemResponse = TypeVar('TItemResponse')
TItem = TypeVar('TItem')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Report(Generic[TItemResponse, TItem]):
    item: Optional[TItem] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BookingsCountsPerConsultantResponseReport(Report[BookingsCountsPerConsultantItemResponse, BookingCountsPerConsultant]):
    pass


@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 AgentivityError:
    error_code: Optional[str] = None
    message: Optional[str] = None
    status_code: Optional[str] = None
    verbose_message: Optional[str] = None


TItem = TypeVar('TItem')
TReport = TypeVar('TReport')


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


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BookingsCountsPerConsultantItemResponse(ItemResponse[BookingCountsPerConsultant, BookingsCountsPerConsultantResponseReport]):
    pass


# @Flags()
class FormattingStyle(IntEnum):
    NONE = 0
    HTML = 1
    CHARTING = 2


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BookingsCountsPerConsultant(CompanyLevelRequestBase):
    pnr_creation_date_start: Optional[str] = None
    """
    Date in format YYYYMMDD
    """

    pnr_creation_date_end: Optional[str] = None
    """
    Date in format YYYYMMDD
    """

    owning_agency_location_i_d: Optional[List[str]] = None
    """
    Comma Delimited List of PCCs
    """

    team: Optional[str] = None
    """
    Team name
    """

    qualifier: Optional[str] = None
    """
    Qualifier
    """

    only_summary: bool = False
    """
    List only summary if selected true
    """

    include_itinerary: bool = False
    """
    Include Itinerary in the response
    """

    itinerary_formatting: Optional[FormattingStyle] = None
    """
    Indicates the required formatting: 0=None(Default); 1= Html; 2 = Chart
    """

    repeat: bool = False
    """
    Repeat
    """

Python BookingsCountsPerConsultant 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.

GET /BookingsCountsPerConsultant HTTP/1.1 
Host: api.agentivity.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
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":{"OwningConsultant":"String","OwningConsultantID":"String","TotalBookings":0,"CancelledCount":0,"ContainingAirCount":0,"GDSTicketedCount":0,"LowCostCarrierCount":0,"AssumedTicketedCount":0,"ChurnCount":0,"QualifierCount":0,"CountryCount":"String","RoboticTicketingCount":0,"RecordLocator":"String","Account":"String","TravelDate":"\/Date(-62135596800000-0000)\/","Remark":"String","Passangers":"String","AgentivityRef":0,"PNRCreationDate":"\/Date(-62135596800000-0000)\/","AgentInitials":"String","Itinerary":[{"SegmentType":"String","SegmentNbr":0,"BoardPoint":"String","OffPoint":"String","OperatorCode":"String","OperatorService":"String","SegmentStatus":"String","DepartureTimeFormatted":"String","ArrivalTimeFormatted":"String","ChangeOfDayFormatted":"String","ServiceCode":"String","StartDate":"String","EndDate":"String","TicketNumber":"String","VendorLocators":"String","EquipmentCode":"String","Equipment":"String"}],"ItineraryFormatted":"String"}},"ResponseError":{"ErrorCode":"String","Message":"String","StatusCode":"String","VerboseMessage":"String"}}