| GET | /EventBookings |
|---|
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 EventBooking(IBookingItinerary):
record_locator: Optional[str] = None
pnr_creation_date: datetime.datetime = datetime.datetime(1, 1, 1)
pax_list: Optional[str] = None
pax_count: int = 0
inbound_airline: Optional[str] = None
inbound_flight_number: Optional[str] = None
inbound_arrival_city: Optional[str] = None
inbound_arrival_date: Optional[datetime.datetime] = None
inbound_arrival_time: Optional[str] = None
outbound_airline: Optional[str] = None
outbound_flight_number: Optional[str] = None
outbound_departure_city: Optional[str] = None
outbound_departure_date: Optional[datetime.datetime] = None
outbound_departure_time: Optional[str] = None
notes: Optional[str] = None
emails: Optional[str] = None
mobile: Optional[str] = None
total_ticketed_value: Optional[str] = None
agentivity_ref: int = 0
itinerary_formatted: Optional[str] = None
itinerary: Optional[ItinerarySegmentsCollection] = 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 EventBookingsResponseReport(Report[EventBookingsItemResponse, EventBooking]):
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 EventBookingsItemResponse(ItemResponse[EventBooking, EventBookingsResponseReport]):
pass
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EventBookingsRequest(CompanyLevelRequestBase):
event_code: Optional[str] = None
"""
Event code
"""
split_multiple_passengers: bool = False
"""
Split multiple passengers
"""
include_notes: bool = False
"""
Include notes in the response
"""
include_arrival_departures: bool = False
"""
Include arrival departures
"""
formatting_style: int = 0
"""
Indicate the required formatting: 0=None(Default), 1=Html, 2=Chart
"""
itinerary_segments_to_show: Optional[str] = None
"""
Itinerary segments to show
"""
Python EventBookingsRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /EventBookings HTTP/1.1 Host: servicestack.agentivity.com Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<AgentivityResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="schemas.agentivity.com/types">
<ResponseMetadata>
<Success>false</Success>
<HasCache>false</HasCache>
<HasPaging>false</HasPaging>
<CacheMetadata>
<IsFromCache>false</IsFromCache>
<CachedAt>0001-01-01T00:00:00</CachedAt>
<CacheExpiresAt>0001-01-01T00:00:00</CacheExpiresAt>
</CacheMetadata>
<PagingMetadata>
<Limit>String</Limit>
<Offset>String</Offset>
<ResponseRecords>0</ResponseRecords>
<TotalRecords>0</TotalRecords>
</PagingMetadata>
</ResponseMetadata>
<ResponseReport>
<Item>
<RecordLocator>String</RecordLocator>
<PNRCreationDate>0001-01-01T00:00:00</PNRCreationDate>
<PaxList>String</PaxList>
<PaxCount>0</PaxCount>
<AgentivityRef>0</AgentivityRef>
<ItineraryFormatted>String</ItineraryFormatted>
<Itinerary>
<ItinerarySegment>
<ArrivalTimeFormatted>String</ArrivalTimeFormatted>
<BoardPoint>String</BoardPoint>
<ChangeOfDayFormatted>String</ChangeOfDayFormatted>
<DepartureTimeFormatted>String</DepartureTimeFormatted>
<EndDate>String</EndDate>
<Equipment>String</Equipment>
<EquipmentCode>String</EquipmentCode>
<OffPoint>String</OffPoint>
<OperatorCode>String</OperatorCode>
<OperatorService>String</OperatorService>
<SegmentNbr>0</SegmentNbr>
<SegmentStatus>String</SegmentStatus>
<SegmentType>String</SegmentType>
<ServiceCode>String</ServiceCode>
<StartDate>String</StartDate>
<TicketNumber>String</TicketNumber>
<VendorLocators>String</VendorLocators>
</ItinerarySegment>
</Itinerary>
<InboundAirline>String</InboundAirline>
<InboundFlightNumber>String</InboundFlightNumber>
<InboundArrivalCity>String</InboundArrivalCity>
<InboundArrivalDate>0001-01-01T00:00:00</InboundArrivalDate>
<InboundArrivalTime>String</InboundArrivalTime>
<OutboundAirline>String</OutboundAirline>
<OutboundFlightNumber>String</OutboundFlightNumber>
<OutboundDepartureCity>String</OutboundDepartureCity>
<OutboundDepartureDate>0001-01-01T00:00:00</OutboundDepartureDate>
<OutboundDepartureTime>String</OutboundDepartureTime>
<Notes>String</Notes>
<Emails>String</Emails>
<Mobile>String</Mobile>
<TotalTicketedValue>String</TotalTicketedValue>
</Item>
</ResponseReport>
<ResponseError>
<ErrorCode>String</ErrorCode>
<Message>String</Message>
<StatusCode>String</StatusCode>
<VerboseMessage>String</VerboseMessage>
</ResponseError>
</AgentivityResponse>