You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1366 lines
55 KiB

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