Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

1361 рядки
55 KiB

  1. // Package qpxexpress provides access to the QPX Express API.
  2. //
  3. // See http://developers.google.com/qpx-express
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/qpxexpress/v1"
  8. // ...
  9. // qpxexpressService, err := qpxexpress.New(oauthHttpClient)
  10. package qpxexpress // import "google.golang.org/api/qpxexpress/v1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "qpxExpress:v1"
  41. const apiName = "qpxExpress"
  42. const apiVersion = "v1"
  43. const basePath = "https://www.googleapis.com/qpxExpress/v1/trips/"
  44. func New(client *http.Client) (*Service, error) {
  45. if client == nil {
  46. return nil, errors.New("client is nil")
  47. }
  48. s := &Service{client: client, BasePath: basePath}
  49. s.Trips = NewTripsService(s)
  50. return s, nil
  51. }
  52. type Service struct {
  53. client *http.Client
  54. BasePath string // API endpoint base URL
  55. UserAgent string // optional additional User-Agent fragment
  56. Trips *TripsService
  57. }
  58. func (s *Service) userAgent() string {
  59. if s.UserAgent == "" {
  60. return googleapi.UserAgent
  61. }
  62. return googleapi.UserAgent + " " + s.UserAgent
  63. }
  64. func NewTripsService(s *Service) *TripsService {
  65. rs := &TripsService{s: s}
  66. return rs
  67. }
  68. type TripsService struct {
  69. s *Service
  70. }
  71. // AircraftData: The make, model, and type of an aircraft.
  72. type AircraftData struct {
  73. // Code: The aircraft code. For example, for a Boeing 777 the code would
  74. // be 777.
  75. Code string `json:"code,omitempty"`
  76. // Kind: Identifies this as an aircraftData object. Value: the fixed
  77. // string qpxexpress#aircraftData
  78. Kind string `json:"kind,omitempty"`
  79. // Name: The name of an aircraft, for example Boeing 777.
  80. Name string `json:"name,omitempty"`
  81. // ForceSendFields is a list of field names (e.g. "Code") to
  82. // unconditionally include in API requests. By default, fields with
  83. // empty values are omitted from API requests. However, any non-pointer,
  84. // non-interface field appearing in ForceSendFields will be sent to the
  85. // server regardless of whether the field is empty or not. This may be
  86. // used to include empty fields in Patch requests.
  87. ForceSendFields []string `json:"-"`
  88. // NullFields is a list of field names (e.g. "Code") to include in API
  89. // requests with the JSON null value. By default, fields with empty
  90. // values are omitted from API requests. However, any field with an
  91. // empty value appearing in NullFields will be sent to the server as
  92. // null. It is an error if a field in this list has a non-empty value.
  93. // This may be used to include null fields in Patch requests.
  94. NullFields []string `json:"-"`
  95. }
  96. func (s *AircraftData) MarshalJSON() ([]byte, error) {
  97. type NoMethod AircraftData
  98. raw := NoMethod(*s)
  99. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  100. }
  101. // AirportData: An airport.
  102. type AirportData struct {
  103. // City: The city code an airport is located in. For example, for JFK
  104. // airport, this is NYC.
  105. City string `json:"city,omitempty"`
  106. // Code: An airport's code. For example, for Boston Logan airport, this
  107. // is BOS.
  108. Code string `json:"code,omitempty"`
  109. // Kind: Identifies this as an airport object. Value: the fixed string
  110. // qpxexpress#airportData.
  111. Kind string `json:"kind,omitempty"`
  112. // Name: The name of an airport. For example, for airport BOS the name
  113. // is "Boston Logan International".
  114. Name string `json:"name,omitempty"`
  115. // ForceSendFields is a list of field names (e.g. "City") to
  116. // unconditionally include in API requests. By default, fields with
  117. // empty values are omitted from API requests. However, any non-pointer,
  118. // non-interface field appearing in ForceSendFields will be sent to the
  119. // server regardless of whether the field is empty or not. This may be
  120. // used to include empty fields in Patch requests.
  121. ForceSendFields []string `json:"-"`
  122. // NullFields is a list of field names (e.g. "City") to include in API
  123. // requests with the JSON null value. By default, fields with empty
  124. // values are omitted from API requests. However, any field with an
  125. // empty value appearing in NullFields will be sent to the server as
  126. // null. It is an error if a field in this list has a non-empty value.
  127. // This may be used to include null fields in Patch requests.
  128. NullFields []string `json:"-"`
  129. }
  130. func (s *AirportData) MarshalJSON() ([]byte, error) {
  131. type NoMethod AirportData
  132. raw := NoMethod(*s)
  133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  134. }
  135. // BagDescriptor: Information about an item of baggage.
  136. type BagDescriptor struct {
  137. // CommercialName: Provides the commercial name for an optional service.
  138. CommercialName string `json:"commercialName,omitempty"`
  139. // Count: How many of this type of bag will be checked on this flight.
  140. Count int64 `json:"count,omitempty"`
  141. // Description: A description of the baggage.
  142. Description []string `json:"description,omitempty"`
  143. // Kind: Identifies this as a baggage object. Value: the fixed string
  144. // qpxexpress#bagDescriptor.
  145. Kind string `json:"kind,omitempty"`
  146. // Subcode: The standard IATA subcode used to identify this optional
  147. // service.
  148. Subcode string `json:"subcode,omitempty"`
  149. // ForceSendFields is a list of field names (e.g. "CommercialName") to
  150. // unconditionally include in API requests. By default, fields with
  151. // empty values are omitted from API requests. However, any non-pointer,
  152. // non-interface field appearing in ForceSendFields will be sent to the
  153. // server regardless of whether the field is empty or not. This may be
  154. // used to include empty fields in Patch requests.
  155. ForceSendFields []string `json:"-"`
  156. // NullFields is a list of field names (e.g. "CommercialName") to
  157. // include in API requests with the JSON null value. By default, fields
  158. // with empty values are omitted from API requests. However, any field
  159. // with an empty value appearing in NullFields will be sent to the
  160. // server as null. It is an error if a field in this list has a
  161. // non-empty value. This may be used to include null fields in Patch
  162. // requests.
  163. NullFields []string `json:"-"`
  164. }
  165. func (s *BagDescriptor) MarshalJSON() ([]byte, error) {
  166. type NoMethod BagDescriptor
  167. raw := NoMethod(*s)
  168. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  169. }
  170. // CarrierData: Information about a carrier (ie. an airline, bus line,
  171. // railroad, etc) that might be useful to display to an end-user.
  172. type CarrierData struct {
  173. // Code: The IATA designator of a carrier (airline, etc). For example,
  174. // for American Airlines, the code is AA.
  175. Code string `json:"code,omitempty"`
  176. // Kind: Identifies this as a kind of carrier (ie. an airline, bus line,
  177. // railroad, etc). Value: the fixed string qpxexpress#carrierData.
  178. Kind string `json:"kind,omitempty"`
  179. // Name: The long, full name of a carrier. For example: American
  180. // Airlines.
  181. Name string `json:"name,omitempty"`
  182. // ForceSendFields is a list of field names (e.g. "Code") to
  183. // unconditionally include in API requests. By default, fields with
  184. // empty values are omitted from API requests. However, any non-pointer,
  185. // non-interface field appearing in ForceSendFields will be sent to the
  186. // server regardless of whether the field is empty or not. This may be
  187. // used to include empty fields in Patch requests.
  188. ForceSendFields []string `json:"-"`
  189. // NullFields is a list of field names (e.g. "Code") to include in API
  190. // requests with the JSON null value. By default, fields with empty
  191. // values are omitted from API requests. However, any field with an
  192. // empty value appearing in NullFields will be sent to the server as
  193. // null. It is an error if a field in this list has a non-empty value.
  194. // This may be used to include null fields in Patch requests.
  195. NullFields []string `json:"-"`
  196. }
  197. func (s *CarrierData) MarshalJSON() ([]byte, error) {
  198. type NoMethod CarrierData
  199. raw := NoMethod(*s)
  200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  201. }
  202. // CityData: Information about a city that might be useful to an
  203. // end-user; typically the city of an airport.
  204. type CityData struct {
  205. // Code: The IATA character ID of a city. For example, for Boston this
  206. // is BOS.
  207. Code string `json:"code,omitempty"`
  208. // Country: The two-character country code of the country the city is
  209. // located in. For example, US for the United States of America.
  210. Country string `json:"country,omitempty"`
  211. // Kind: Identifies this as a city, typically with one or more airports.
  212. // Value: the fixed string qpxexpress#cityData.
  213. Kind string `json:"kind,omitempty"`
  214. // Name: The full name of a city. An example would be: New York.
  215. Name string `json:"name,omitempty"`
  216. // ForceSendFields is a list of field names (e.g. "Code") to
  217. // unconditionally include in API requests. By default, fields with
  218. // empty values are omitted from API requests. However, any non-pointer,
  219. // non-interface field appearing in ForceSendFields will be sent to the
  220. // server regardless of whether the field is empty or not. This may be
  221. // used to include empty fields in Patch requests.
  222. ForceSendFields []string `json:"-"`
  223. // NullFields is a list of field names (e.g. "Code") to include in API
  224. // requests with the JSON null value. By default, fields with empty
  225. // values are omitted from API requests. However, any field with an
  226. // empty value appearing in NullFields will be sent to the server as
  227. // null. It is an error if a field in this list has a non-empty value.
  228. // This may be used to include null fields in Patch requests.
  229. NullFields []string `json:"-"`
  230. }
  231. func (s *CityData) MarshalJSON() ([]byte, error) {
  232. type NoMethod CityData
  233. raw := NoMethod(*s)
  234. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  235. }
  236. // Data: Detailed information about components found in the solutions of
  237. // this response, including a trip's airport, city, taxes, airline, and
  238. // aircraft.
  239. type Data struct {
  240. // Aircraft: The aircraft that is flying between an origin and
  241. // destination.
  242. Aircraft []*AircraftData `json:"aircraft,omitempty"`
  243. // Airport: The airport of an origin or destination.
  244. Airport []*AirportData `json:"airport,omitempty"`
  245. // Carrier: The airline carrier of the aircraft flying between an origin
  246. // and destination. Allowed values are IATA carrier codes.
  247. Carrier []*CarrierData `json:"carrier,omitempty"`
  248. // City: The city that is either the origin or destination of part of a
  249. // trip.
  250. City []*CityData `json:"city,omitempty"`
  251. // Kind: Identifies this as QPX Express response resource, including a
  252. // trip's airport, city, taxes, airline, and aircraft. Value: the fixed
  253. // string qpxexpress#data.
  254. Kind string `json:"kind,omitempty"`
  255. // Tax: The taxes due for flying between an origin and a destination.
  256. Tax []*TaxData `json:"tax,omitempty"`
  257. // ForceSendFields is a list of field names (e.g. "Aircraft") to
  258. // unconditionally include in API requests. By default, fields with
  259. // empty values are omitted from API requests. However, any non-pointer,
  260. // non-interface field appearing in ForceSendFields will be sent to the
  261. // server regardless of whether the field is empty or not. This may be
  262. // used to include empty fields in Patch requests.
  263. ForceSendFields []string `json:"-"`
  264. // NullFields is a list of field names (e.g. "Aircraft") to include in
  265. // API requests with the JSON null value. By default, fields with empty
  266. // values are omitted from API requests. However, any field with an
  267. // empty value appearing in NullFields will be sent to the server as
  268. // null. It is an error if a field in this list has a non-empty value.
  269. // This may be used to include null fields in Patch requests.
  270. NullFields []string `json:"-"`
  271. }
  272. func (s *Data) MarshalJSON() ([]byte, error) {
  273. type NoMethod Data
  274. raw := NoMethod(*s)
  275. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  276. }
  277. // FareInfo: Complete information about a fare used in the solution to a
  278. // low-fare search query. In the airline industry a fare is a price an
  279. // airline charges for one-way travel between two points. A fare
  280. // typically contains a carrier code, two city codes, a price, and a
  281. // fare basis. (A fare basis is a one-to-eight character alphanumeric
  282. // code used to identify a fare.)
  283. type FareInfo struct {
  284. BasisCode string `json:"basisCode,omitempty"`
  285. // Carrier: The carrier of the aircraft or other vehicle commuting
  286. // between two points.
  287. Carrier string `json:"carrier,omitempty"`
  288. // Destination: The city code of the city the trip ends at.
  289. Destination string `json:"destination,omitempty"`
  290. // Id: A unique identifier of the fare.
  291. Id string `json:"id,omitempty"`
  292. // Kind: Identifies this as a fare object. Value: the fixed string
  293. // qpxexpress#fareInfo.
  294. Kind string `json:"kind,omitempty"`
  295. // Origin: The city code of the city the trip begins at.
  296. Origin string `json:"origin,omitempty"`
  297. // Private: Whether this is a private fare, for example one offered only
  298. // to select customers rather than the general public.
  299. Private bool `json:"private,omitempty"`
  300. // ForceSendFields is a list of field names (e.g. "BasisCode") to
  301. // unconditionally include in API requests. By default, fields with
  302. // empty values are omitted from API requests. However, any non-pointer,
  303. // non-interface field appearing in ForceSendFields will be sent to the
  304. // server regardless of whether the field is empty or not. This may be
  305. // used to include empty fields in Patch requests.
  306. ForceSendFields []string `json:"-"`
  307. // NullFields is a list of field names (e.g. "BasisCode") to include in
  308. // API requests with the JSON null value. By default, fields with empty
  309. // values are omitted from API requests. However, any field with an
  310. // empty value appearing in NullFields will be sent to the server as
  311. // null. It is an error if a field in this list has a non-empty value.
  312. // This may be used to include null fields in Patch requests.
  313. NullFields []string `json:"-"`
  314. }
  315. func (s *FareInfo) MarshalJSON() ([]byte, error) {
  316. type NoMethod FareInfo
  317. raw := NoMethod(*s)
  318. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  319. }
  320. // FlightInfo: A flight is a sequence of legs with the same airline
  321. // carrier and flight number. (A leg is the smallest unit of travel, in
  322. // the case of a flight a takeoff immediately followed by a landing at
  323. // two set points on a particular carrier with a particular flight
  324. // number.) The naive view is that a flight is scheduled travel of an
  325. // aircraft between two points, with possibly intermediate stops, but
  326. // carriers will frequently list flights that require a change of
  327. // aircraft between legs.
  328. type FlightInfo struct {
  329. Carrier string `json:"carrier,omitempty"`
  330. // Number: The flight number.
  331. Number string `json:"number,omitempty"`
  332. // ForceSendFields is a list of field names (e.g. "Carrier") to
  333. // unconditionally include in API requests. By default, fields with
  334. // empty values are omitted from API requests. However, any non-pointer,
  335. // non-interface field appearing in ForceSendFields will be sent to the
  336. // server regardless of whether the field is empty or not. This may be
  337. // used to include empty fields in Patch requests.
  338. ForceSendFields []string `json:"-"`
  339. // NullFields is a list of field names (e.g. "Carrier") to include in
  340. // API requests with the JSON null value. By default, fields with empty
  341. // values are omitted from API requests. However, any field with an
  342. // empty value appearing in NullFields will be sent to the server as
  343. // null. It is an error if a field in this list has a non-empty value.
  344. // This may be used to include null fields in Patch requests.
  345. NullFields []string `json:"-"`
  346. }
  347. func (s *FlightInfo) MarshalJSON() ([]byte, error) {
  348. type NoMethod FlightInfo
  349. raw := NoMethod(*s)
  350. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  351. }
  352. // FreeBaggageAllowance: Information about free baggage allowed on one
  353. // segment of a trip.
  354. type FreeBaggageAllowance struct {
  355. // BagDescriptor: A representation of a type of bag, such as an ATPCo
  356. // subcode, Commercial Name, or other description.
  357. BagDescriptor []*BagDescriptor `json:"bagDescriptor,omitempty"`
  358. // Kilos: The maximum number of kilos all the free baggage together may
  359. // weigh.
  360. Kilos int64 `json:"kilos,omitempty"`
  361. // KilosPerPiece: The maximum number of kilos any one piece of baggage
  362. // may weigh.
  363. KilosPerPiece int64 `json:"kilosPerPiece,omitempty"`
  364. // Kind: Identifies this as free baggage object, allowed on one segment
  365. // of a trip. Value: the fixed string qpxexpress#freeBaggageAllowance.
  366. Kind string `json:"kind,omitempty"`
  367. // Pieces: The number of free pieces of baggage allowed.
  368. Pieces int64 `json:"pieces,omitempty"`
  369. // Pounds: The number of pounds of free baggage allowed.
  370. Pounds int64 `json:"pounds,omitempty"`
  371. // ForceSendFields is a list of field names (e.g. "BagDescriptor") to
  372. // unconditionally include in API requests. By default, fields with
  373. // empty values are omitted from API requests. However, any non-pointer,
  374. // non-interface field appearing in ForceSendFields will be sent to the
  375. // server regardless of whether the field is empty or not. This may be
  376. // used to include empty fields in Patch requests.
  377. ForceSendFields []string `json:"-"`
  378. // NullFields is a list of field names (e.g. "BagDescriptor") to include
  379. // in API requests with the JSON null value. By default, fields with
  380. // empty values are omitted from API requests. However, any field with
  381. // an empty value appearing in NullFields will be sent to the server as
  382. // null. It is an error if a field in this list has a non-empty value.
  383. // This may be used to include null fields in Patch requests.
  384. NullFields []string `json:"-"`
  385. }
  386. func (s *FreeBaggageAllowance) MarshalJSON() ([]byte, error) {
  387. type NoMethod FreeBaggageAllowance
  388. raw := NoMethod(*s)
  389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  390. }
  391. // LegInfo: Information about a leg. (A leg is the smallest unit of
  392. // travel, in the case of a flight a takeoff immediately followed by a
  393. // landing at two set points on a particular carrier with a particular
  394. // flight number.)
  395. type LegInfo struct {
  396. // Aircraft: The aircraft (or bus, ferry, railcar, etc) travelling
  397. // between the two points of this leg.
  398. Aircraft string `json:"aircraft,omitempty"`
  399. // ArrivalTime: The scheduled time of arrival at the destination of the
  400. // leg, local to the point of arrival.
  401. ArrivalTime string `json:"arrivalTime,omitempty"`
  402. // ChangePlane: Whether you have to change planes following this leg.
  403. // Only applies to the next leg.
  404. ChangePlane bool `json:"changePlane,omitempty"`
  405. // ConnectionDuration: Duration of a connection following this leg, in
  406. // minutes.
  407. ConnectionDuration int64 `json:"connectionDuration,omitempty"`
  408. // DepartureTime: The scheduled departure time of the leg, local to the
  409. // point of departure.
  410. DepartureTime string `json:"departureTime,omitempty"`
  411. // Destination: The leg destination as a city and airport.
  412. Destination string `json:"destination,omitempty"`
  413. // DestinationTerminal: The terminal the flight is scheduled to arrive
  414. // at.
  415. DestinationTerminal string `json:"destinationTerminal,omitempty"`
  416. // Duration: The scheduled travelling time from the origin to the
  417. // destination.
  418. Duration int64 `json:"duration,omitempty"`
  419. // Id: An identifier that uniquely identifies this leg in the solution.
  420. Id string `json:"id,omitempty"`
  421. // Kind: Identifies this as a leg object. A leg is the smallest unit of
  422. // travel, in the case of a flight a takeoff immediately followed by a
  423. // landing at two set points on a particular carrier with a particular
  424. // flight number. Value: the fixed string qpxexpress#legInfo.
  425. Kind string `json:"kind,omitempty"`
  426. // Meal: A simple, general description of the meal(s) served on the
  427. // flight, for example: "Hot meal".
  428. Meal string `json:"meal,omitempty"`
  429. // Mileage: The number of miles in this leg.
  430. Mileage int64 `json:"mileage,omitempty"`
  431. // OnTimePerformance: In percent, the published on time performance on
  432. // this leg.
  433. OnTimePerformance int64 `json:"onTimePerformance,omitempty"`
  434. // OperatingDisclosure: Department of Transportation disclosure
  435. // information on the actual operator of a flight in a code share. (A
  436. // code share refers to a marketing agreement between two carriers,
  437. // where one carrier will list in its schedules (and take bookings for)
  438. // flights that are actually operated by another carrier.)
  439. OperatingDisclosure string `json:"operatingDisclosure,omitempty"`
  440. // Origin: The leg origin as a city and airport.
  441. Origin string `json:"origin,omitempty"`
  442. // OriginTerminal: The terminal the flight is scheduled to depart from.
  443. OriginTerminal string `json:"originTerminal,omitempty"`
  444. // Secure: Whether passenger information must be furnished to the United
  445. // States Transportation Security Administration (TSA) prior to
  446. // departure.
  447. Secure bool `json:"secure,omitempty"`
  448. // ForceSendFields is a list of field names (e.g. "Aircraft") to
  449. // unconditionally include in API requests. By default, fields with
  450. // empty values are omitted from API requests. However, any non-pointer,
  451. // non-interface field appearing in ForceSendFields will be sent to the
  452. // server regardless of whether the field is empty or not. This may be
  453. // used to include empty fields in Patch requests.
  454. ForceSendFields []string `json:"-"`
  455. // NullFields is a list of field names (e.g. "Aircraft") to include in
  456. // API requests with the JSON null value. By default, fields with empty
  457. // values are omitted from API requests. However, any field with an
  458. // empty value appearing in NullFields will be sent to the server as
  459. // null. It is an error if a field in this list has a non-empty value.
  460. // This may be used to include null fields in Patch requests.
  461. NullFields []string `json:"-"`
  462. }
  463. func (s *LegInfo) MarshalJSON() ([]byte, error) {
  464. type NoMethod LegInfo
  465. raw := NoMethod(*s)
  466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  467. }
  468. // PassengerCounts: The number and type of passengers. Unfortunately the
  469. // definition of an infant, child, adult, and senior citizen varies
  470. // across carriers and reservation systems.
  471. type PassengerCounts struct {
  472. // AdultCount: The number of passengers that are adults.
  473. AdultCount int64 `json:"adultCount,omitempty"`
  474. // ChildCount: The number of passengers that are children.
  475. ChildCount int64 `json:"childCount,omitempty"`
  476. // InfantInLapCount: The number of passengers that are infants
  477. // travelling in the lap of an adult.
  478. InfantInLapCount int64 `json:"infantInLapCount,omitempty"`
  479. // InfantInSeatCount: The number of passengers that are infants each
  480. // assigned a seat.
  481. InfantInSeatCount int64 `json:"infantInSeatCount,omitempty"`
  482. // Kind: Identifies this as a passenger count object, representing the
  483. // number of passengers. Value: the fixed string
  484. // qpxexpress#passengerCounts.
  485. Kind string `json:"kind,omitempty"`
  486. // SeniorCount: The number of passengers that are senior citizens.
  487. SeniorCount int64 `json:"seniorCount,omitempty"`
  488. // ForceSendFields is a list of field names (e.g. "AdultCount") to
  489. // unconditionally include in API requests. By default, fields with
  490. // empty values are omitted from API requests. However, any non-pointer,
  491. // non-interface field appearing in ForceSendFields will be sent to the
  492. // server regardless of whether the field is empty or not. This may be
  493. // used to include empty fields in Patch requests.
  494. ForceSendFields []string `json:"-"`
  495. // NullFields is a list of field names (e.g. "AdultCount") to include in
  496. // API requests with the JSON null value. By default, fields with empty
  497. // values are omitted from API requests. However, any field with an
  498. // empty value appearing in NullFields will be sent to the server as
  499. // null. It is an error if a field in this list has a non-empty value.
  500. // This may be used to include null fields in Patch requests.
  501. NullFields []string `json:"-"`
  502. }
  503. func (s *PassengerCounts) MarshalJSON() ([]byte, error) {
  504. type NoMethod PassengerCounts
  505. raw := NoMethod(*s)
  506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  507. }
  508. // PricingInfo: The price of one or more travel segments. The currency
  509. // used to purchase tickets is usually determined by the sale/ticketing
  510. // city or the sale/ticketing country, unless none are specified, in
  511. // which case it defaults to that of the journey origin country.
  512. type PricingInfo struct {
  513. // BaseFareTotal: The total fare in the base fare currency (the currency
  514. // of the country of origin). This element is only present when the
  515. // sales currency and the currency of the country of commencement are
  516. // different.
  517. BaseFareTotal string `json:"baseFareTotal,omitempty"`
  518. // Fare: The fare used to price one or more segments.
  519. Fare []*FareInfo `json:"fare,omitempty"`
  520. // FareCalculation: The horizontal fare calculation. This is a field on
  521. // a ticket that displays all of the relevant items that go into the
  522. // calculation of the fare.
  523. FareCalculation string `json:"fareCalculation,omitempty"`
  524. // Kind: Identifies this as a pricing object, representing the price of
  525. // one or more travel segments. Value: the fixed string
  526. // qpxexpress#pricingInfo.
  527. Kind string `json:"kind,omitempty"`
  528. // LatestTicketingTime: The latest ticketing time for this pricing
  529. // assuming the reservation occurs at ticketing time and there is no
  530. // change in fares/rules. The time is local to the point of sale (POS).
  531. LatestTicketingTime string `json:"latestTicketingTime,omitempty"`
  532. // Passengers: The number of passengers to which this price applies.
  533. Passengers *PassengerCounts `json:"passengers,omitempty"`
  534. // Ptc: The passenger type code for this pricing. An alphanumeric code
  535. // used by a carrier to restrict fares to certain categories of
  536. // passenger. For instance, a fare might be valid only for senior
  537. // citizens.
  538. Ptc string `json:"ptc,omitempty"`
  539. // Refundable: Whether the fares on this pricing are refundable.
  540. Refundable bool `json:"refundable,omitempty"`
  541. // SaleFareTotal: The total fare in the sale or equivalent currency.
  542. SaleFareTotal string `json:"saleFareTotal,omitempty"`
  543. // SaleTaxTotal: The taxes in the sale or equivalent currency.
  544. SaleTaxTotal string `json:"saleTaxTotal,omitempty"`
  545. // SaleTotal: Total per-passenger price (fare and tax) in the sale or
  546. // equivalent currency.
  547. SaleTotal string `json:"saleTotal,omitempty"`
  548. // SegmentPricing: The per-segment price and baggage information.
  549. SegmentPricing []*SegmentPricing `json:"segmentPricing,omitempty"`
  550. // Tax: The taxes used to calculate the tax total per ticket.
  551. Tax []*TaxInfo `json:"tax,omitempty"`
  552. // ForceSendFields is a list of field names (e.g. "BaseFareTotal") to
  553. // unconditionally include in API requests. By default, fields with
  554. // empty values are omitted from API requests. However, any non-pointer,
  555. // non-interface field appearing in ForceSendFields will be sent to the
  556. // server regardless of whether the field is empty or not. This may be
  557. // used to include empty fields in Patch requests.
  558. ForceSendFields []string `json:"-"`
  559. // NullFields is a list of field names (e.g. "BaseFareTotal") to include
  560. // in API requests with the JSON null value. By default, fields with
  561. // empty values are omitted from API requests. However, any field with
  562. // an empty value appearing in NullFields will be sent to the server as
  563. // null. It is an error if a field in this list has a non-empty value.
  564. // This may be used to include null fields in Patch requests.
  565. NullFields []string `json:"-"`
  566. }
  567. func (s *PricingInfo) MarshalJSON() ([]byte, error) {
  568. type NoMethod PricingInfo
  569. raw := NoMethod(*s)
  570. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  571. }
  572. // SegmentInfo: Details of a segment of a flight; a segment is one or
  573. // more consecutive legs on the same flight. For example a hypothetical
  574. // flight ZZ001, from DFW to OGG, would have one segment with two legs:
  575. // DFW to HNL (leg 1), HNL to OGG (leg 2), and DFW to OGG (legs 1 and
  576. // 2).
  577. type SegmentInfo struct {
  578. // BookingCode: The booking code or class for this segment.
  579. BookingCode string `json:"bookingCode,omitempty"`
  580. // BookingCodeCount: The number of seats available in this booking code
  581. // on this segment.
  582. BookingCodeCount int64 `json:"bookingCodeCount,omitempty"`
  583. // Cabin: The cabin booked for this segment.
  584. Cabin string `json:"cabin,omitempty"`
  585. // ConnectionDuration: In minutes, the duration of the connection
  586. // following this segment.
  587. ConnectionDuration int64 `json:"connectionDuration,omitempty"`
  588. // Duration: The duration of the flight segment in minutes.
  589. Duration int64 `json:"duration,omitempty"`
  590. // Flight: The flight this is a segment of.
  591. Flight *FlightInfo `json:"flight,omitempty"`
  592. // Id: An id uniquely identifying the segment in the solution.
  593. Id string `json:"id,omitempty"`
  594. // Kind: Identifies this as a segment object. A segment is one or more
  595. // consecutive legs on the same flight. For example a hypothetical
  596. // flight ZZ001, from DFW to OGG, could have one segment with two legs:
  597. // DFW to HNL (leg 1), HNL to OGG (leg 2). Value: the fixed string
  598. // qpxexpress#segmentInfo.
  599. Kind string `json:"kind,omitempty"`
  600. // Leg: The legs composing this segment.
  601. Leg []*LegInfo `json:"leg,omitempty"`
  602. // MarriedSegmentGroup: The solution-based index of a segment in a
  603. // married segment group. Married segments can only be booked together.
  604. // For example, an airline might report a certain booking code as sold
  605. // out from Boston to Pittsburgh, but as available as part of two
  606. // married segments Boston to Chicago connecting through Pittsburgh. For
  607. // example content of this field, consider the round-trip flight ZZ1
  608. // PHX-PHL ZZ2 PHL-CLT ZZ3 CLT-PHX. This has three segments, with the
  609. // two outbound ones (ZZ1 ZZ2) married. In this case, the two outbound
  610. // segments belong to married segment group 0, and the return segment
  611. // belongs to married segment group 1.
  612. MarriedSegmentGroup string `json:"marriedSegmentGroup,omitempty"`
  613. // SubjectToGovernmentApproval: Whether the operation of this segment
  614. // remains subject to government approval.
  615. SubjectToGovernmentApproval bool `json:"subjectToGovernmentApproval,omitempty"`
  616. // ForceSendFields is a list of field names (e.g. "BookingCode") to
  617. // unconditionally include in API requests. By default, fields with
  618. // empty values are omitted from API requests. However, any non-pointer,
  619. // non-interface field appearing in ForceSendFields will be sent to the
  620. // server regardless of whether the field is empty or not. This may be
  621. // used to include empty fields in Patch requests.
  622. ForceSendFields []string `json:"-"`
  623. // NullFields is a list of field names (e.g. "BookingCode") to include
  624. // in API requests with the JSON null value. By default, fields with
  625. // empty values are omitted from API requests. However, any field with
  626. // an empty value appearing in NullFields will be sent to the server as
  627. // null. It is an error if a field in this list has a non-empty value.
  628. // This may be used to include null fields in Patch requests.
  629. NullFields []string `json:"-"`
  630. }
  631. func (s *SegmentInfo) MarshalJSON() ([]byte, error) {
  632. type NoMethod SegmentInfo
  633. raw := NoMethod(*s)
  634. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  635. }
  636. // SegmentPricing: The price of this segment.
  637. type SegmentPricing struct {
  638. // FareId: A segment identifier unique within a single solution. It is
  639. // used to refer to different parts of the same solution.
  640. FareId string `json:"fareId,omitempty"`
  641. // FreeBaggageOption: Details of the free baggage allowance on this
  642. // segment.
  643. FreeBaggageOption []*FreeBaggageAllowance `json:"freeBaggageOption,omitempty"`
  644. // Kind: Identifies this as a segment pricing object, representing the
  645. // price of this segment. Value: the fixed string
  646. // qpxexpress#segmentPricing.
  647. Kind string `json:"kind,omitempty"`
  648. // SegmentId: Unique identifier in the response of this segment.
  649. SegmentId string `json:"segmentId,omitempty"`
  650. // ForceSendFields is a list of field names (e.g. "FareId") to
  651. // unconditionally include in API requests. By default, fields with
  652. // empty values are omitted from API requests. However, any non-pointer,
  653. // non-interface field appearing in ForceSendFields will be sent to the
  654. // server regardless of whether the field is empty or not. This may be
  655. // used to include empty fields in Patch requests.
  656. ForceSendFields []string `json:"-"`
  657. // NullFields is a list of field names (e.g. "FareId") to include in API
  658. // requests with the JSON null value. By default, fields with empty
  659. // values are omitted from API requests. However, any field with an
  660. // empty value appearing in NullFields will be sent to the server as
  661. // null. It is an error if a field in this list has a non-empty value.
  662. // This may be used to include null fields in Patch requests.
  663. NullFields []string `json:"-"`
  664. }
  665. func (s *SegmentPricing) MarshalJSON() ([]byte, error) {
  666. type NoMethod SegmentPricing
  667. raw := NoMethod(*s)
  668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  669. }
  670. // SliceInfo: Information about a slice. A slice represents a
  671. // traveller's intent, the portion of a low-fare search corresponding to
  672. // a traveler's request to get between two points. One-way journeys are
  673. // generally expressed using 1 slice, round-trips using 2. For example,
  674. // if a traveler specifies the following trip in a user interface:
  675. // | Origin | Destination | Departure Date | | BOS | LAX | March 10,
  676. // 2007 | | LAX | SYD | March 17, 2007 | | SYD | BOS | March 22, 2007
  677. // |
  678. // then this is a three slice trip.
  679. type SliceInfo struct {
  680. // Duration: The duration of the slice in minutes.
  681. Duration int64 `json:"duration,omitempty"`
  682. // Kind: Identifies this as a slice object. A slice represents a
  683. // traveller's intent, the portion of a low-fare search corresponding to
  684. // a traveler's request to get between two points. One-way journeys are
  685. // generally expressed using 1 slice, round-trips using 2. Value: the
  686. // fixed string qpxexpress#sliceInfo.
  687. Kind string `json:"kind,omitempty"`
  688. // Segment: The segment(s) constituting the slice.
  689. Segment []*SegmentInfo `json:"segment,omitempty"`
  690. // ForceSendFields is a list of field names (e.g. "Duration") to
  691. // unconditionally include in API requests. By default, fields with
  692. // empty values are omitted from API requests. However, any non-pointer,
  693. // non-interface field appearing in ForceSendFields will be sent to the
  694. // server regardless of whether the field is empty or not. This may be
  695. // used to include empty fields in Patch requests.
  696. ForceSendFields []string `json:"-"`
  697. // NullFields is a list of field names (e.g. "Duration") to include in
  698. // API requests with the JSON null value. By default, fields with empty
  699. // values are omitted from API requests. However, any field with an
  700. // empty value appearing in NullFields will be sent to the server as
  701. // null. It is an error if a field in this list has a non-empty value.
  702. // This may be used to include null fields in Patch requests.
  703. NullFields []string `json:"-"`
  704. }
  705. func (s *SliceInfo) MarshalJSON() ([]byte, error) {
  706. type NoMethod SliceInfo
  707. raw := NoMethod(*s)
  708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  709. }
  710. // SliceInput: Criteria a desired slice must satisfy.
  711. type SliceInput struct {
  712. // Alliance: Slices with only the carriers in this alliance should be
  713. // returned; do not use this field with permittedCarrier. Allowed values
  714. // are ONEWORLD, SKYTEAM, and STAR.
  715. Alliance string `json:"alliance,omitempty"`
  716. // Date: Departure date in YYYY-MM-DD format.
  717. Date string `json:"date,omitempty"`
  718. // Destination: Airport or city IATA designator of the destination.
  719. Destination string `json:"destination,omitempty"`
  720. // Kind: Identifies this as a slice input object, representing the
  721. // criteria a desired slice must satisfy. Value: the fixed string
  722. // qpxexpress#sliceInput.
  723. Kind string `json:"kind,omitempty"`
  724. // MaxConnectionDuration: The longest connection between two legs, in
  725. // minutes, you are willing to accept.
  726. MaxConnectionDuration int64 `json:"maxConnectionDuration,omitempty"`
  727. // MaxStops: The maximum number of stops you are willing to accept in
  728. // this slice.
  729. MaxStops int64 `json:"maxStops,omitempty"`
  730. // Origin: Airport or city IATA designator of the origin.
  731. Origin string `json:"origin,omitempty"`
  732. // PermittedCarrier: A list of 2-letter IATA airline designators. Slices
  733. // with only these carriers should be returned.
  734. PermittedCarrier []string `json:"permittedCarrier,omitempty"`
  735. // PermittedDepartureTime: Slices must depart in this time of day range,
  736. // local to the point of departure.
  737. PermittedDepartureTime *TimeOfDayRange `json:"permittedDepartureTime,omitempty"`
  738. // PreferredCabin: Prefer solutions that book in this cabin for this
  739. // slice. Allowed values are COACH, PREMIUM_COACH, BUSINESS, and FIRST.
  740. PreferredCabin string `json:"preferredCabin,omitempty"`
  741. // ProhibitedCarrier: A list of 2-letter IATA airline designators.
  742. // Exclude slices that use these carriers.
  743. ProhibitedCarrier []string `json:"prohibitedCarrier,omitempty"`
  744. // ForceSendFields is a list of field names (e.g. "Alliance") to
  745. // unconditionally include in API requests. By default, fields with
  746. // empty values are omitted from API requests. However, any non-pointer,
  747. // non-interface field appearing in ForceSendFields will be sent to the
  748. // server regardless of whether the field is empty or not. This may be
  749. // used to include empty fields in Patch requests.
  750. ForceSendFields []string `json:"-"`
  751. // NullFields is a list of field names (e.g. "Alliance") to include in
  752. // API requests with the JSON null value. By default, fields with empty
  753. // values are omitted from API requests. However, any field with an
  754. // empty value appearing in NullFields will be sent to the server as
  755. // null. It is an error if a field in this list has a non-empty value.
  756. // This may be used to include null fields in Patch requests.
  757. NullFields []string `json:"-"`
  758. }
  759. func (s *SliceInput) MarshalJSON() ([]byte, error) {
  760. type NoMethod SliceInput
  761. raw := NoMethod(*s)
  762. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  763. }
  764. // TaxData: Tax data.
  765. type TaxData struct {
  766. // Id: An identifier uniquely identifying a tax in a response.
  767. Id string `json:"id,omitempty"`
  768. // Kind: Identifies this as a tax data object, representing some tax.
  769. // Value: the fixed string qpxexpress#taxData.
  770. Kind string `json:"kind,omitempty"`
  771. // Name: The name of a tax.
  772. Name string `json:"name,omitempty"`
  773. // ForceSendFields is a list of field names (e.g. "Id") to
  774. // unconditionally include in API requests. By default, fields with
  775. // empty values are omitted from API requests. However, any non-pointer,
  776. // non-interface field appearing in ForceSendFields will be sent to the
  777. // server regardless of whether the field is empty or not. This may be
  778. // used to include empty fields in Patch requests.
  779. ForceSendFields []string `json:"-"`
  780. // NullFields is a list of field names (e.g. "Id") to include in API
  781. // requests with the JSON null value. By default, fields with empty
  782. // values are omitted from API requests. However, any field with an
  783. // empty value appearing in NullFields will be sent to the server as
  784. // null. It is an error if a field in this list has a non-empty value.
  785. // This may be used to include null fields in Patch requests.
  786. NullFields []string `json:"-"`
  787. }
  788. func (s *TaxData) MarshalJSON() ([]byte, error) {
  789. type NoMethod TaxData
  790. raw := NoMethod(*s)
  791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  792. }
  793. // TaxInfo: Tax information.
  794. type TaxInfo struct {
  795. // ChargeType: Whether this is a government charge or a carrier
  796. // surcharge.
  797. ChargeType string `json:"chargeType,omitempty"`
  798. // Code: The code to enter in the ticket's tax box.
  799. Code string `json:"code,omitempty"`
  800. // Country: For government charges, the country levying the charge.
  801. Country string `json:"country,omitempty"`
  802. // Id: Identifier uniquely identifying this tax in a response. Not
  803. // present for unnamed carrier surcharges.
  804. Id string `json:"id,omitempty"`
  805. // Kind: Identifies this as a tax information object. Value: the fixed
  806. // string qpxexpress#taxInfo.
  807. Kind string `json:"kind,omitempty"`
  808. // SalePrice: The price of the tax in the sales or equivalent currency.
  809. SalePrice string `json:"salePrice,omitempty"`
  810. // ForceSendFields is a list of field names (e.g. "ChargeType") to
  811. // unconditionally include in API requests. By default, fields with
  812. // empty values are omitted from API requests. However, any non-pointer,
  813. // non-interface field appearing in ForceSendFields will be sent to the
  814. // server regardless of whether the field is empty or not. This may be
  815. // used to include empty fields in Patch requests.
  816. ForceSendFields []string `json:"-"`
  817. // NullFields is a list of field names (e.g. "ChargeType") to include in
  818. // API requests with the JSON null value. By default, fields with empty
  819. // values are omitted from API requests. However, any field with an
  820. // empty value appearing in NullFields will be sent to the server as
  821. // null. It is an error if a field in this list has a non-empty value.
  822. // This may be used to include null fields in Patch requests.
  823. NullFields []string `json:"-"`
  824. }
  825. func (s *TaxInfo) MarshalJSON() ([]byte, error) {
  826. type NoMethod TaxInfo
  827. raw := NoMethod(*s)
  828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  829. }
  830. // TimeOfDayRange: Two times in a single day defining a time range.
  831. type TimeOfDayRange struct {
  832. // EarliestTime: The earliest time of day in HH:MM format.
  833. EarliestTime string `json:"earliestTime,omitempty"`
  834. // Kind: Identifies this as a time of day range object, representing two
  835. // times in a single day defining a time range. Value: the fixed string
  836. // qpxexpress#timeOfDayRange.
  837. Kind string `json:"kind,omitempty"`
  838. // LatestTime: The latest time of day in HH:MM format.
  839. LatestTime string `json:"latestTime,omitempty"`
  840. // ForceSendFields is a list of field names (e.g. "EarliestTime") to
  841. // unconditionally include in API requests. By default, fields with
  842. // empty values are omitted from API requests. However, any non-pointer,
  843. // non-interface field appearing in ForceSendFields will be sent to the
  844. // server regardless of whether the field is empty or not. This may be
  845. // used to include empty fields in Patch requests.
  846. ForceSendFields []string `json:"-"`
  847. // NullFields is a list of field names (e.g. "EarliestTime") to include
  848. // in API requests with the JSON null value. By default, fields with
  849. // empty values are omitted from API requests. However, any field with
  850. // an empty value appearing in NullFields will be sent to the server as
  851. // null. It is an error if a field in this list has a non-empty value.
  852. // This may be used to include null fields in Patch requests.
  853. NullFields []string `json:"-"`
  854. }
  855. func (s *TimeOfDayRange) MarshalJSON() ([]byte, error) {
  856. type NoMethod TimeOfDayRange
  857. raw := NoMethod(*s)
  858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  859. }
  860. // TripOption: Trip information.
  861. type TripOption struct {
  862. // Id: Identifier uniquely identifying this trip in a response.
  863. Id string `json:"id,omitempty"`
  864. // Kind: Identifies this as a trip information object. Value: the fixed
  865. // string qpxexpress#tripOption.
  866. Kind string `json:"kind,omitempty"`
  867. // Pricing: Per passenger pricing information.
  868. Pricing []*PricingInfo `json:"pricing,omitempty"`
  869. // SaleTotal: The total price for all passengers on the trip, in the
  870. // form of a currency followed by an amount, e.g. USD253.35.
  871. SaleTotal string `json:"saleTotal,omitempty"`
  872. // Slice: The slices that make up this trip's itinerary.
  873. Slice []*SliceInfo `json:"slice,omitempty"`
  874. // ForceSendFields is a list of field names (e.g. "Id") to
  875. // unconditionally include in API requests. By default, fields with
  876. // empty values are omitted from API requests. However, any non-pointer,
  877. // non-interface field appearing in ForceSendFields will be sent to the
  878. // server regardless of whether the field is empty or not. This may be
  879. // used to include empty fields in Patch requests.
  880. ForceSendFields []string `json:"-"`
  881. // NullFields is a list of field names (e.g. "Id") to include in API
  882. // requests with the JSON null value. By default, fields with empty
  883. // values are omitted from API requests. However, any field with an
  884. // empty value appearing in NullFields will be sent to the server as
  885. // null. It is an error if a field in this list has a non-empty value.
  886. // This may be used to include null fields in Patch requests.
  887. NullFields []string `json:"-"`
  888. }
  889. func (s *TripOption) MarshalJSON() ([]byte, error) {
  890. type NoMethod TripOption
  891. raw := NoMethod(*s)
  892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  893. }
  894. // TripOptionsRequest: A QPX Express search request, which will yield
  895. // one or more solutions.
  896. type TripOptionsRequest struct {
  897. // MaxPrice: Do not return solutions that cost more than this price. The
  898. // alphabetical part of the price is in ISO 4217. The format, in regex,
  899. // is [A-Z]{3}\d+(\.\d+)? Example: $102.07
  900. MaxPrice string `json:"maxPrice,omitempty"`
  901. // Passengers: Counts for each passenger type in the request.
  902. Passengers *PassengerCounts `json:"passengers,omitempty"`
  903. // Refundable: Return only solutions with refundable fares.
  904. Refundable bool `json:"refundable,omitempty"`
  905. // SaleCountry: IATA country code representing the point of sale. This
  906. // determines the "equivalent amount paid" currency for the ticket.
  907. SaleCountry string `json:"saleCountry,omitempty"`
  908. // Slice: The slices that make up the itinerary of this trip. A slice
  909. // represents a traveler's intent, the portion of a low-fare search
  910. // corresponding to a traveler's request to get between two points.
  911. // One-way journeys are generally expressed using one slice, round-trips
  912. // using two. An example of a one slice trip with three segments might
  913. // be BOS-SYD, SYD-LAX, LAX-BOS if the traveler only stopped in SYD and
  914. // LAX just long enough to change planes.
  915. Slice []*SliceInput `json:"slice,omitempty"`
  916. // Solutions: The number of solutions to return, maximum 500.
  917. Solutions int64 `json:"solutions,omitempty"`
  918. // TicketingCountry: IATA country code representing the point of
  919. // ticketing.
  920. TicketingCountry string `json:"ticketingCountry,omitempty"`
  921. // ForceSendFields is a list of field names (e.g. "MaxPrice") to
  922. // unconditionally include in API requests. By default, fields with
  923. // empty values are omitted from API requests. However, any non-pointer,
  924. // non-interface field appearing in ForceSendFields will be sent to the
  925. // server regardless of whether the field is empty or not. This may be
  926. // used to include empty fields in Patch requests.
  927. ForceSendFields []string `json:"-"`
  928. // NullFields is a list of field names (e.g. "MaxPrice") to include in
  929. // API requests with the JSON null value. By default, fields with empty
  930. // values are omitted from API requests. However, any field with an
  931. // empty value appearing in NullFields will be sent to the server as
  932. // null. It is an error if a field in this list has a non-empty value.
  933. // This may be used to include null fields in Patch requests.
  934. NullFields []string `json:"-"`
  935. }
  936. func (s *TripOptionsRequest) MarshalJSON() ([]byte, error) {
  937. type NoMethod TripOptionsRequest
  938. raw := NoMethod(*s)
  939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  940. }
  941. // TripOptionsResponse: A QPX Express search response.
  942. type TripOptionsResponse struct {
  943. // Data: Informational data global to list of solutions.
  944. Data *Data `json:"data,omitempty"`
  945. // Kind: Identifies this as a QPX Express trip response object, which
  946. // consists of zero or more solutions. Value: the fixed string
  947. // qpxexpress#tripOptions.
  948. Kind string `json:"kind,omitempty"`
  949. // RequestId: An identifier uniquely identifying this response.
  950. RequestId string `json:"requestId,omitempty"`
  951. // TripOption: A list of priced itinerary solutions to the QPX Express
  952. // query.
  953. TripOption []*TripOption `json:"tripOption,omitempty"`
  954. // ForceSendFields is a list of field names (e.g. "Data") to
  955. // unconditionally include in API requests. By default, fields with
  956. // empty values are omitted from API requests. However, any non-pointer,
  957. // non-interface field appearing in ForceSendFields will be sent to the
  958. // server regardless of whether the field is empty or not. This may be
  959. // used to include empty fields in Patch requests.
  960. ForceSendFields []string `json:"-"`
  961. // NullFields is a list of field names (e.g. "Data") to include in API
  962. // requests with the JSON null value. By default, fields with empty
  963. // values are omitted from API requests. However, any field with an
  964. // empty value appearing in NullFields will be sent to the server as
  965. // null. It is an error if a field in this list has a non-empty value.
  966. // This may be used to include null fields in Patch requests.
  967. NullFields []string `json:"-"`
  968. }
  969. func (s *TripOptionsResponse) MarshalJSON() ([]byte, error) {
  970. type NoMethod TripOptionsResponse
  971. raw := NoMethod(*s)
  972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  973. }
  974. // TripsSearchRequest: A QPX Express search request.
  975. type TripsSearchRequest struct {
  976. // Request: A QPX Express search request. Required values are at least
  977. // one adult or senior passenger, an origin, a destination, and a date.
  978. Request *TripOptionsRequest `json:"request,omitempty"`
  979. // ForceSendFields is a list of field names (e.g. "Request") to
  980. // unconditionally include in API requests. By default, fields with
  981. // empty values are omitted from API requests. However, any non-pointer,
  982. // non-interface field appearing in ForceSendFields will be sent to the
  983. // server regardless of whether the field is empty or not. This may be
  984. // used to include empty fields in Patch requests.
  985. ForceSendFields []string `json:"-"`
  986. // NullFields is a list of field names (e.g. "Request") to include in
  987. // API requests with the JSON null value. By default, fields with empty
  988. // values are omitted from API requests. However, any field with an
  989. // empty value appearing in NullFields will be sent to the server as
  990. // null. It is an error if a field in this list has a non-empty value.
  991. // This may be used to include null fields in Patch requests.
  992. NullFields []string `json:"-"`
  993. }
  994. func (s *TripsSearchRequest) MarshalJSON() ([]byte, error) {
  995. type NoMethod TripsSearchRequest
  996. raw := NoMethod(*s)
  997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  998. }
  999. // TripsSearchResponse: A QPX Express search response.
  1000. type TripsSearchResponse struct {
  1001. // Kind: Identifies this as a QPX Express API search response resource.
  1002. // Value: the fixed string qpxExpress#tripsSearch.
  1003. Kind string `json:"kind,omitempty"`
  1004. // Trips: All possible solutions to the QPX Express search request.
  1005. Trips *TripOptionsResponse `json:"trips,omitempty"`
  1006. // ServerResponse contains the HTTP response code and headers from the
  1007. // server.
  1008. googleapi.ServerResponse `json:"-"`
  1009. // ForceSendFields is a list of field names (e.g. "Kind") to
  1010. // unconditionally include in API requests. By default, fields with
  1011. // empty values are omitted from API requests. However, any non-pointer,
  1012. // non-interface field appearing in ForceSendFields will be sent to the
  1013. // server regardless of whether the field is empty or not. This may be
  1014. // used to include empty fields in Patch requests.
  1015. ForceSendFields []string `json:"-"`
  1016. // NullFields is a list of field names (e.g. "Kind") to include in API
  1017. // requests with the JSON null value. By default, fields with empty
  1018. // values are omitted from API requests. However, any field with an
  1019. // empty value appearing in NullFields will be sent to the server as
  1020. // null. It is an error if a field in this list has a non-empty value.
  1021. // This may be used to include null fields in Patch requests.
  1022. NullFields []string `json:"-"`
  1023. }
  1024. func (s *TripsSearchResponse) MarshalJSON() ([]byte, error) {
  1025. type NoMethod TripsSearchResponse
  1026. raw := NoMethod(*s)
  1027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1028. }
  1029. // method id "qpxExpress.trips.search":
  1030. type TripsSearchCall struct {
  1031. s *Service
  1032. tripssearchrequest *TripsSearchRequest
  1033. urlParams_ gensupport.URLParams
  1034. ctx_ context.Context
  1035. header_ http.Header
  1036. }
  1037. // Search: Returns a list of flights.
  1038. func (r *TripsService) Search(tripssearchrequest *TripsSearchRequest) *TripsSearchCall {
  1039. c := &TripsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1040. c.tripssearchrequest = tripssearchrequest
  1041. return c
  1042. }
  1043. // Fields allows partial responses to be retrieved. See
  1044. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1045. // for more information.
  1046. func (c *TripsSearchCall) Fields(s ...googleapi.Field) *TripsSearchCall {
  1047. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1048. return c
  1049. }
  1050. // Context sets the context to be used in this call's Do method. Any
  1051. // pending HTTP request will be aborted if the provided context is
  1052. // canceled.
  1053. func (c *TripsSearchCall) Context(ctx context.Context) *TripsSearchCall {
  1054. c.ctx_ = ctx
  1055. return c
  1056. }
  1057. // Header returns an http.Header that can be modified by the caller to
  1058. // add HTTP headers to the request.
  1059. func (c *TripsSearchCall) Header() http.Header {
  1060. if c.header_ == nil {
  1061. c.header_ = make(http.Header)
  1062. }
  1063. return c.header_
  1064. }
  1065. func (c *TripsSearchCall) doRequest(alt string) (*http.Response, error) {
  1066. reqHeaders := make(http.Header)
  1067. for k, v := range c.header_ {
  1068. reqHeaders[k] = v
  1069. }
  1070. reqHeaders.Set("User-Agent", c.s.userAgent())
  1071. var body io.Reader = nil
  1072. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tripssearchrequest)
  1073. if err != nil {
  1074. return nil, err
  1075. }
  1076. reqHeaders.Set("Content-Type", "application/json")
  1077. c.urlParams_.Set("alt", alt)
  1078. urls := googleapi.ResolveRelative(c.s.BasePath, "search")
  1079. urls += "?" + c.urlParams_.Encode()
  1080. req, _ := http.NewRequest("POST", urls, body)
  1081. req.Header = reqHeaders
  1082. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1083. }
  1084. // Do executes the "qpxExpress.trips.search" call.
  1085. // Exactly one of *TripsSearchResponse or error will be non-nil. Any
  1086. // non-2xx status code is an error. Response headers are in either
  1087. // *TripsSearchResponse.ServerResponse.Header or (if a response was
  1088. // returned at all) in error.(*googleapi.Error).Header. Use
  1089. // googleapi.IsNotModified to check whether the returned error was
  1090. // because http.StatusNotModified was returned.
  1091. func (c *TripsSearchCall) Do(opts ...googleapi.CallOption) (*TripsSearchResponse, error) {
  1092. gensupport.SetOptions(c.urlParams_, opts...)
  1093. res, err := c.doRequest("json")
  1094. if res != nil && res.StatusCode == http.StatusNotModified {
  1095. if res.Body != nil {
  1096. res.Body.Close()
  1097. }
  1098. return nil, &googleapi.Error{
  1099. Code: res.StatusCode,
  1100. Header: res.Header,
  1101. }
  1102. }
  1103. if err != nil {
  1104. return nil, err
  1105. }
  1106. defer googleapi.CloseBody(res)
  1107. if err := googleapi.CheckResponse(res); err != nil {
  1108. return nil, err
  1109. }
  1110. ret := &TripsSearchResponse{
  1111. ServerResponse: googleapi.ServerResponse{
  1112. Header: res.Header,
  1113. HTTPStatusCode: res.StatusCode,
  1114. },
  1115. }
  1116. target := &ret
  1117. if err := gensupport.DecodeResponse(target, res); err != nil {
  1118. return nil, err
  1119. }
  1120. return ret, nil
  1121. // {
  1122. // "description": "Returns a list of flights.",
  1123. // "httpMethod": "POST",
  1124. // "id": "qpxExpress.trips.search",
  1125. // "path": "search",
  1126. // "request": {
  1127. // "$ref": "TripsSearchRequest"
  1128. // },
  1129. // "response": {
  1130. // "$ref": "TripsSearchResponse"
  1131. // }
  1132. // }
  1133. }