GET | /DistributorBookingsByAirlineClass |
---|
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 BookingByAirlineWithClassSupport:
agentivity_ref: int = 0
record_locator: Optional[str] = None
pnr_creation_date: Optional[datetime.datetime] = None
account: Optional[str] = None
owning_consultant: Optional[str] = None
ticketed_status_code: Optional[str] = None
ticketed_status: Optional[str] = None
booking_codes_booked: Optional[str] = None
flight_numbers: Optional[str] = None
routing: Optional[str] = None
tracking_code: Optional[str] = None
tkt_tour_code: 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 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 BookingsByAirlineWithClassSupportItemResponse(ItemResponse[BookingByAirlineWithClassSupport, BookingsByAirlineWithClassSupportResponseReport]):
pass
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 BookingsByAirlineWithClassSupportResponseReport(Report[BookingsByAirlineWithClassSupportItemResponse, BookingByAirlineWithClassSupport]):
pass
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DistributorBookingsByAirlineClassItemResponse(ItemResponse[BookingByAirlineWithClassSupport, BookingsByAirlineWithClassSupportResponseReport]):
pass
# @Flags()
class FormattingStyle(IntEnum):
NONE = 0
HTML = 1
CHARTING = 2
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetDistributorBookingsTravellingByAirlineClass(PagingMetadata):
distributor_i_d: int = 0
"""
ID of Distributor
"""
issue_date_start: Optional[str] = None
"""
Date in format YYYYMMDD
"""
issue_date_end: Optional[str] = None
"""
Date in format YYYYMMDD
"""
plating_carrier: Optional[str] = None
"""
Two letter code for carrier
"""
booking_class_name: Optional[str] = None
"""
Booking Class Name
"""
board_point_country_code: Optional[str] = None
"""
BoardPoint CountryCode
"""
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
"""
Python GetDistributorBookingsTravellingByAirlineClass DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /DistributorBookingsByAirlineClass 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":{"Item":{"AgentivityRef":0,"RecordLocator":"String","PNRCreationDate":"\/Date(-62135596800000-0000)\/","Account":"String","OwningConsultant":"String","TicketedStatusCode":"String","TicketedStatus":"String","BookingCodesBooked":"String","FlightNumbers":"String","Routing":"String","TrackingCode":"String","TktTourCode":"String"}},"ResponseError":{"ErrorCode":"String","Message":"String","StatusCode":"String","VerboseMessage":"String"}}