~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/google.golang.org/api/qpxexpress/v1/qpxexpress-gen.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
11
 
 
12
import (
 
13
        "bytes"
 
14
        "encoding/json"
 
15
        "errors"
 
16
        "fmt"
 
17
        "google.golang.org/api/googleapi"
 
18
        "io"
 
19
        "net/http"
 
20
        "net/url"
 
21
        "strconv"
 
22
        "strings"
 
23
)
 
24
 
 
25
// Always reference these packages, just in case the auto-generated code
 
26
// below doesn't.
 
27
var _ = bytes.NewBuffer
 
28
var _ = strconv.Itoa
 
29
var _ = fmt.Sprintf
 
30
var _ = json.NewDecoder
 
31
var _ = io.Copy
 
32
var _ = url.Parse
 
33
var _ = googleapi.Version
 
34
var _ = errors.New
 
35
var _ = strings.Replace
 
36
 
 
37
const apiId = "qpxExpress:v1"
 
38
const apiName = "qpxExpress"
 
39
const apiVersion = "v1"
 
40
const basePath = "https://www.googleapis.com/qpxExpress/v1/trips/"
 
41
 
 
42
func New(client *http.Client) (*Service, error) {
 
43
        if client == nil {
 
44
                return nil, errors.New("client is nil")
 
45
        }
 
46
        s := &Service{client: client, BasePath: basePath}
 
47
        s.Trips = NewTripsService(s)
 
48
        return s, nil
 
49
}
 
50
 
 
51
type Service struct {
 
52
        client   *http.Client
 
53
        BasePath string // API endpoint base URL
 
54
 
 
55
        Trips *TripsService
 
56
}
 
57
 
 
58
func NewTripsService(s *Service) *TripsService {
 
59
        rs := &TripsService{s: s}
 
60
        return rs
 
61
}
 
62
 
 
63
type TripsService struct {
 
64
        s *Service
 
65
}
 
66
 
 
67
type AircraftData struct {
 
68
        // Code: The aircraft code. For example, for a Boeing 777 the code would
 
69
        // be 777.
 
70
        Code string `json:"code,omitempty"`
 
71
 
 
72
        // Kind: Identifies this as an aircraftData object. Value: the fixed
 
73
        // string qpxexpress#aircraftData
 
74
        Kind string `json:"kind,omitempty"`
 
75
 
 
76
        // Name: The name of an aircraft, for example Boeing 777.
 
77
        Name string `json:"name,omitempty"`
 
78
}
 
79
 
 
80
type AirportData struct {
 
81
        // City: The city code an airport is located in. For example, for JFK
 
82
        // airport, this is NYC.
 
83
        City string `json:"city,omitempty"`
 
84
 
 
85
        // Code: An airport's code. For example, for Boston Logan airport, this
 
86
        // is BOS.
 
87
        Code string `json:"code,omitempty"`
 
88
 
 
89
        // Kind: Identifies this as an airport object. Value: the fixed string
 
90
        // qpxexpress#airportData.
 
91
        Kind string `json:"kind,omitempty"`
 
92
 
 
93
        // Name: The name of an airport. For example, for airport BOS the name
 
94
        // is "Boston Logan International".
 
95
        Name string `json:"name,omitempty"`
 
96
}
 
97
 
 
98
type BagDescriptor struct {
 
99
        // CommercialName: Provides the commercial name for an optional service.
 
100
        CommercialName string `json:"commercialName,omitempty"`
 
101
 
 
102
        // Count: How many of this type of bag will be checked on this flight.
 
103
        Count int64 `json:"count,omitempty"`
 
104
 
 
105
        // Description: A description of the baggage.
 
106
        Description []string `json:"description,omitempty"`
 
107
 
 
108
        // Kind: Identifies this as a baggage object. Value: the fixed string
 
109
        // qpxexpress#bagDescriptor.
 
110
        Kind string `json:"kind,omitempty"`
 
111
 
 
112
        // Subcode: The standard IATA subcode used to identify this optional
 
113
        // service.
 
114
        Subcode string `json:"subcode,omitempty"`
 
115
}
 
116
 
 
117
type CarrierData struct {
 
118
        // Code: The IATA designator of a carrier (airline, etc). For example,
 
119
        // for American Airlines, the code is AA.
 
120
        Code string `json:"code,omitempty"`
 
121
 
 
122
        // Kind: Identifies this as a kind of carrier (ie. an airline, bus line,
 
123
        // railroad, etc). Value: the fixed string qpxexpress#carrierData.
 
124
        Kind string `json:"kind,omitempty"`
 
125
 
 
126
        // Name: The long, full name of a carrier. For example: American
 
127
        // Airlines.
 
128
        Name string `json:"name,omitempty"`
 
129
}
 
130
 
 
131
type CityData struct {
 
132
        // Code: The IATA character ID of a city. For example, for Boston this
 
133
        // is BOS.
 
134
        Code string `json:"code,omitempty"`
 
135
 
 
136
        // Country: The two-character country code of the country the city is
 
137
        // located in. For example, US for the United States of America.
 
138
        Country string `json:"country,omitempty"`
 
139
 
 
140
        // Kind: Identifies this as a city, typically with one or more airports.
 
141
        // Value: the fixed string qpxexpress#cityData.
 
142
        Kind string `json:"kind,omitempty"`
 
143
 
 
144
        // Name: The full name of a city. An example would be: New York.
 
145
        Name string `json:"name,omitempty"`
 
146
}
 
147
 
 
148
type Data struct {
 
149
        // Aircraft: The aircraft that is flying between an origin and
 
150
        // destination.
 
151
        Aircraft []*AircraftData `json:"aircraft,omitempty"`
 
152
 
 
153
        // Airport: The airport of an origin or destination.
 
154
        Airport []*AirportData `json:"airport,omitempty"`
 
155
 
 
156
        // Carrier: The airline carrier of the aircraft flying between an origin
 
157
        // and destination. Allowed values are IATA carrier codes.
 
158
        Carrier []*CarrierData `json:"carrier,omitempty"`
 
159
 
 
160
        // City: The city that is either the origin or destination of part of a
 
161
        // trip.
 
162
        City []*CityData `json:"city,omitempty"`
 
163
 
 
164
        // Kind: Identifies this as QPX Express response resource, including a
 
165
        // trip's airport, city, taxes, airline, and aircraft. Value: the fixed
 
166
        // string qpxexpress#data.
 
167
        Kind string `json:"kind,omitempty"`
 
168
 
 
169
        // Tax: The taxes due for flying between an origin and a destination.
 
170
        Tax []*TaxData `json:"tax,omitempty"`
 
171
}
 
172
 
 
173
type FareInfo struct {
 
174
        BasisCode string `json:"basisCode,omitempty"`
 
175
 
 
176
        // Carrier: The carrier of the aircraft or other vehicle commuting
 
177
        // between two points.
 
178
        Carrier string `json:"carrier,omitempty"`
 
179
 
 
180
        // Destination: The city code of the city the trip ends at.
 
181
        Destination string `json:"destination,omitempty"`
 
182
 
 
183
        // Id: A unique identifier of the fare.
 
184
        Id string `json:"id,omitempty"`
 
185
 
 
186
        // Kind: Identifies this as a fare object. Value: the fixed string
 
187
        // qpxexpress#fareInfo.
 
188
        Kind string `json:"kind,omitempty"`
 
189
 
 
190
        // Origin: The city code of the city the trip begins at.
 
191
        Origin string `json:"origin,omitempty"`
 
192
 
 
193
        // Private: Whether this is a private fare, for example one offered only
 
194
        // to select customers rather than the general public.
 
195
        Private bool `json:"private,omitempty"`
 
196
}
 
197
 
 
198
type FlightInfo struct {
 
199
        Carrier string `json:"carrier,omitempty"`
 
200
 
 
201
        // Number: The flight number.
 
202
        Number string `json:"number,omitempty"`
 
203
}
 
204
 
 
205
type FreeBaggageAllowance struct {
 
206
        // BagDescriptor: A representation of a type of bag, such as an ATPCo
 
207
        // subcode, Commercial Name, or other description.
 
208
        BagDescriptor []*BagDescriptor `json:"bagDescriptor,omitempty"`
 
209
 
 
210
        // Kilos: The maximum number of kilos all the free baggage together may
 
211
        // weigh.
 
212
        Kilos int64 `json:"kilos,omitempty"`
 
213
 
 
214
        // KilosPerPiece: The maximum number of kilos any one piece of baggage
 
215
        // may weigh.
 
216
        KilosPerPiece int64 `json:"kilosPerPiece,omitempty"`
 
217
 
 
218
        // Kind: Identifies this as free baggage object, allowed on one segment
 
219
        // of a trip. Value: the fixed string qpxexpress#freeBaggageAllowance.
 
220
        Kind string `json:"kind,omitempty"`
 
221
 
 
222
        // Pieces: The number of free pieces of baggage allowed.
 
223
        Pieces int64 `json:"pieces,omitempty"`
 
224
 
 
225
        // Pounds: The number of pounds of free baggage allowed.
 
226
        Pounds int64 `json:"pounds,omitempty"`
 
227
}
 
228
 
 
229
type LegInfo struct {
 
230
        // Aircraft: The aircraft (or bus, ferry, railcar, etc) travelling
 
231
        // between the two points of this leg.
 
232
        Aircraft string `json:"aircraft,omitempty"`
 
233
 
 
234
        // ArrivalTime: The scheduled time of arrival at the destination of the
 
235
        // leg, local to the point of arrival.
 
236
        ArrivalTime string `json:"arrivalTime,omitempty"`
 
237
 
 
238
        // ChangePlane: Whether you have to change planes following this leg.
 
239
        // Only applies to the next leg.
 
240
        ChangePlane bool `json:"changePlane,omitempty"`
 
241
 
 
242
        // ConnectionDuration: Duration of a connection following this leg, in
 
243
        // minutes.
 
244
        ConnectionDuration int64 `json:"connectionDuration,omitempty"`
 
245
 
 
246
        // DepartureTime: The scheduled departure time of the leg, local to the
 
247
        // point of departure.
 
248
        DepartureTime string `json:"departureTime,omitempty"`
 
249
 
 
250
        // Destination: The leg destination as a city and airport.
 
251
        Destination string `json:"destination,omitempty"`
 
252
 
 
253
        // DestinationTerminal: The terminal the flight is scheduled to arrive
 
254
        // at.
 
255
        DestinationTerminal string `json:"destinationTerminal,omitempty"`
 
256
 
 
257
        // Duration: The scheduled travelling time from the origin to the
 
258
        // destination.
 
259
        Duration int64 `json:"duration,omitempty"`
 
260
 
 
261
        // Id: An identifier that uniquely identifies this leg in the solution.
 
262
        Id string `json:"id,omitempty"`
 
263
 
 
264
        // Kind: Identifies this as a leg object. A leg is the smallest unit of
 
265
        // travel, in the case of a flight a takeoff immediately followed by a
 
266
        // landing at two set points on a particular carrier with a particular
 
267
        // flight number. Value: the fixed string qpxexpress#legInfo.
 
268
        Kind string `json:"kind,omitempty"`
 
269
 
 
270
        // Meal: A simple, general description of the meal(s) served on the
 
271
        // flight, for example: "Hot meal".
 
272
        Meal string `json:"meal,omitempty"`
 
273
 
 
274
        // Mileage: The number of miles in this leg.
 
275
        Mileage int64 `json:"mileage,omitempty"`
 
276
 
 
277
        // OnTimePerformance: In percent, the published on time performance on
 
278
        // this leg.
 
279
        OnTimePerformance int64 `json:"onTimePerformance,omitempty"`
 
280
 
 
281
        // OperatingDisclosure: Department of Transportation disclosure
 
282
        // information on the actual operator of a flight in a code share. (A
 
283
        // code share refers to a marketing agreement between two carriers,
 
284
        // where one carrier will list in its schedules (and take bookings for)
 
285
        // flights that are actually operated by another carrier.)
 
286
        OperatingDisclosure string `json:"operatingDisclosure,omitempty"`
 
287
 
 
288
        // Origin: The leg origin as a city and airport.
 
289
        Origin string `json:"origin,omitempty"`
 
290
 
 
291
        // OriginTerminal: The terminal the flight is scheduled to depart from.
 
292
        OriginTerminal string `json:"originTerminal,omitempty"`
 
293
 
 
294
        // Secure: Whether passenger information must be furnished to the United
 
295
        // States Transportation Security Administration (TSA) prior to
 
296
        // departure.
 
297
        Secure bool `json:"secure,omitempty"`
 
298
}
 
299
 
 
300
type PassengerCounts struct {
 
301
        // AdultCount: The number of passengers that are adults.
 
302
        AdultCount int64 `json:"adultCount,omitempty"`
 
303
 
 
304
        // ChildCount: The number of passengers that are children.
 
305
        ChildCount int64 `json:"childCount,omitempty"`
 
306
 
 
307
        // InfantInLapCount: The number of passengers that are infants
 
308
        // travelling in the lap of an adult.
 
309
        InfantInLapCount int64 `json:"infantInLapCount,omitempty"`
 
310
 
 
311
        // InfantInSeatCount: The number of passengers that are infants each
 
312
        // assigned a seat.
 
313
        InfantInSeatCount int64 `json:"infantInSeatCount,omitempty"`
 
314
 
 
315
        // Kind: Identifies this as a passenger count object, representing the
 
316
        // number of passengers. Value: the fixed string
 
317
        // qpxexpress#passengerCounts.
 
318
        Kind string `json:"kind,omitempty"`
 
319
 
 
320
        // SeniorCount: The number of passengers that are senior citizens.
 
321
        SeniorCount int64 `json:"seniorCount,omitempty"`
 
322
}
 
323
 
 
324
type PricingInfo struct {
 
325
        // BaseFareTotal: The total fare in the base fare currency (the currency
 
326
        // of the country of origin). This element is only present when the
 
327
        // sales currency and the currency of the country of commencement are
 
328
        // different.
 
329
        BaseFareTotal string `json:"baseFareTotal,omitempty"`
 
330
 
 
331
        // Fare: The fare used to price one or more segments.
 
332
        Fare []*FareInfo `json:"fare,omitempty"`
 
333
 
 
334
        // FareCalculation: The horizontal fare calculation. This is a field on
 
335
        // a ticket that displays all of the relevant items that go into the
 
336
        // calculation of the fare.
 
337
        FareCalculation string `json:"fareCalculation,omitempty"`
 
338
 
 
339
        // Kind: Identifies this as a pricing object, representing the price of
 
340
        // one or more travel segments. Value: the fixed string
 
341
        // qpxexpress#pricingInfo.
 
342
        Kind string `json:"kind,omitempty"`
 
343
 
 
344
        // LatestTicketingTime: The latest ticketing time for this pricing
 
345
        // assuming the reservation occurs at ticketing time and there is no
 
346
        // change in fares/rules. The time is local to the point of sale (POS).
 
347
        LatestTicketingTime string `json:"latestTicketingTime,omitempty"`
 
348
 
 
349
        // Passengers: The number of passengers to which this price applies.
 
350
        Passengers *PassengerCounts `json:"passengers,omitempty"`
 
351
 
 
352
        // Ptc: The passenger type code for this pricing. An alphanumeric code
 
353
        // used by a carrier to restrict fares to certain categories of
 
354
        // passenger. For instance, a fare might be valid only for senior
 
355
        // citizens.
 
356
        Ptc string `json:"ptc,omitempty"`
 
357
 
 
358
        // Refundable: Whether the fares on this pricing are refundable.
 
359
        Refundable bool `json:"refundable,omitempty"`
 
360
 
 
361
        // SaleFareTotal: The total fare in the sale or equivalent currency.
 
362
        SaleFareTotal string `json:"saleFareTotal,omitempty"`
 
363
 
 
364
        // SaleTaxTotal: The taxes in the sale or equivalent currency.
 
365
        SaleTaxTotal string `json:"saleTaxTotal,omitempty"`
 
366
 
 
367
        // SaleTotal: Total per-passenger price (fare and tax) in the sale or
 
368
        // equivalent currency.
 
369
        SaleTotal string `json:"saleTotal,omitempty"`
 
370
 
 
371
        // SegmentPricing: The per-segment price and baggage information.
 
372
        SegmentPricing []*SegmentPricing `json:"segmentPricing,omitempty"`
 
373
 
 
374
        // Tax: The taxes used to calculate the tax total per ticket.
 
375
        Tax []*TaxInfo `json:"tax,omitempty"`
 
376
}
 
377
 
 
378
type SegmentInfo struct {
 
379
        // BookingCode: The booking code or class for this segment.
 
380
        BookingCode string `json:"bookingCode,omitempty"`
 
381
 
 
382
        // BookingCodeCount: The number of seats available in this booking code
 
383
        // on this segment.
 
384
        BookingCodeCount int64 `json:"bookingCodeCount,omitempty"`
 
385
 
 
386
        // Cabin: The cabin booked for this segment.
 
387
        Cabin string `json:"cabin,omitempty"`
 
388
 
 
389
        // ConnectionDuration: In minutes, the duration of the connection
 
390
        // following this segment.
 
391
        ConnectionDuration int64 `json:"connectionDuration,omitempty"`
 
392
 
 
393
        // Duration: The duration of the flight segment in minutes.
 
394
        Duration int64 `json:"duration,omitempty"`
 
395
 
 
396
        // Flight: The flight this is a segment of.
 
397
        Flight *FlightInfo `json:"flight,omitempty"`
 
398
 
 
399
        // Id: An id uniquely identifying the segment in the solution.
 
400
        Id string `json:"id,omitempty"`
 
401
 
 
402
        // Kind: Identifies this as a segment object. A segment is one or more
 
403
        // consecutive legs on the same flight. For example a hypothetical
 
404
        // flight ZZ001, from DFW to OGG, could have one segment with two legs:
 
405
        // DFW to HNL (leg 1), HNL to OGG (leg 2). Value: the fixed string
 
406
        // qpxexpress#segmentInfo.
 
407
        Kind string `json:"kind,omitempty"`
 
408
 
 
409
        // Leg: The legs composing this segment.
 
410
        Leg []*LegInfo `json:"leg,omitempty"`
 
411
 
 
412
        // MarriedSegmentGroup: The solution-based index of a segment in a
 
413
        // married segment group. Married segments can only be booked together.
 
414
        // For example, an airline might report a certain booking code as sold
 
415
        // out from Boston to Pittsburgh, but as available as part of two
 
416
        // married segments Boston to Chicago connecting through Pittsburgh. For
 
417
        // example content of this field, consider the round-trip flight ZZ1
 
418
        // PHX-PHL ZZ2 PHL-CLT ZZ3 CLT-PHX. This has three segments, with the
 
419
        // two outbound ones (ZZ1 ZZ2) married. In this case, the two outbound
 
420
        // segments belong to married segment group 0, and the return segment
 
421
        // belongs to married segment group 1.
 
422
        MarriedSegmentGroup string `json:"marriedSegmentGroup,omitempty"`
 
423
 
 
424
        // SubjectToGovernmentApproval: Whether the operation of this segment
 
425
        // remains subject to government approval.
 
426
        SubjectToGovernmentApproval bool `json:"subjectToGovernmentApproval,omitempty"`
 
427
}
 
428
 
 
429
type SegmentPricing struct {
 
430
        // FareId: A segment identifier unique within a single solution. It is
 
431
        // used to refer to different parts of the same solution.
 
432
        FareId string `json:"fareId,omitempty"`
 
433
 
 
434
        // FreeBaggageOption: Details of the free baggage allowance on this
 
435
        // segment.
 
436
        FreeBaggageOption []*FreeBaggageAllowance `json:"freeBaggageOption,omitempty"`
 
437
 
 
438
        // Kind: Identifies this as a segment pricing object, representing the
 
439
        // price of this segment. Value: the fixed string
 
440
        // qpxexpress#segmentPricing.
 
441
        Kind string `json:"kind,omitempty"`
 
442
 
 
443
        // SegmentId: Unique identifier in the response of this segment.
 
444
        SegmentId string `json:"segmentId,omitempty"`
 
445
}
 
446
 
 
447
type SliceInfo struct {
 
448
        // Duration: The duration of the slice in minutes.
 
449
        Duration int64 `json:"duration,omitempty"`
 
450
 
 
451
        // Kind: Identifies this as a slice object. A slice represents a
 
452
        // traveller's intent, the portion of a low-fare search corresponding to
 
453
        // a traveler's request to get between two points. One-way journeys are
 
454
        // generally expressed using 1 slice, round-trips using 2. Value: the
 
455
        // fixed string qpxexpress#sliceInfo.
 
456
        Kind string `json:"kind,omitempty"`
 
457
 
 
458
        // Segment: The segment(s) constituting the slice.
 
459
        Segment []*SegmentInfo `json:"segment,omitempty"`
 
460
}
 
461
 
 
462
type SliceInput struct {
 
463
        // Alliance: Slices with only the carriers in this alliance should be
 
464
        // returned; do not use this field with permittedCarrier. Allowed values
 
465
        // are ONEWORLD, SKYTEAM, and STAR.
 
466
        Alliance string `json:"alliance,omitempty"`
 
467
 
 
468
        // Date: Departure date in YYYY-MM-DD format.
 
469
        Date string `json:"date,omitempty"`
 
470
 
 
471
        // Destination: Airport or city IATA designator of the destination.
 
472
        Destination string `json:"destination,omitempty"`
 
473
 
 
474
        // Kind: Identifies this as a slice input object, representing the
 
475
        // criteria a desired slice must satisfy. Value: the fixed string
 
476
        // qpxexpress#sliceInput.
 
477
        Kind string `json:"kind,omitempty"`
 
478
 
 
479
        // MaxConnectionDuration: The longest connection between two legs, in
 
480
        // minutes, you are willing to accept.
 
481
        MaxConnectionDuration int64 `json:"maxConnectionDuration,omitempty"`
 
482
 
 
483
        // MaxStops: The maximum number of stops you are willing to accept in
 
484
        // this slice.
 
485
        MaxStops int64 `json:"maxStops,omitempty"`
 
486
 
 
487
        // Origin: Airport or city IATA designator of the origin.
 
488
        Origin string `json:"origin,omitempty"`
 
489
 
 
490
        // PermittedCarrier: A list of 2-letter IATA airline designators. Slices
 
491
        // with only these carriers should be returned.
 
492
        PermittedCarrier []string `json:"permittedCarrier,omitempty"`
 
493
 
 
494
        // PermittedDepartureTime: Slices must depart in this time of day range,
 
495
        // local to the point of departure.
 
496
        PermittedDepartureTime *TimeOfDayRange `json:"permittedDepartureTime,omitempty"`
 
497
 
 
498
        // PreferredCabin: Prefer solutions that book in this cabin for this
 
499
        // slice. Allowed values are COACH, PREMIUM_COACH, BUSINESS, and FIRST.
 
500
        PreferredCabin string `json:"preferredCabin,omitempty"`
 
501
 
 
502
        // ProhibitedCarrier: A list of 2-letter IATA airline designators.
 
503
        // Exclude slices that use these carriers.
 
504
        ProhibitedCarrier []string `json:"prohibitedCarrier,omitempty"`
 
505
}
 
506
 
 
507
type TaxData struct {
 
508
        // Id: An identifier uniquely identifying a tax in a response.
 
509
        Id string `json:"id,omitempty"`
 
510
 
 
511
        // Kind: Identifies this as a tax data object, representing some tax.
 
512
        // Value: the fixed string qpxexpress#taxData.
 
513
        Kind string `json:"kind,omitempty"`
 
514
 
 
515
        // Name: The name of a tax.
 
516
        Name string `json:"name,omitempty"`
 
517
}
 
518
 
 
519
type TaxInfo struct {
 
520
        // ChargeType: Whether this is a government charge or a carrier
 
521
        // surcharge.
 
522
        ChargeType string `json:"chargeType,omitempty"`
 
523
 
 
524
        // Code: The code to enter in the ticket's tax box.
 
525
        Code string `json:"code,omitempty"`
 
526
 
 
527
        // Country: For government charges, the country levying the charge.
 
528
        Country string `json:"country,omitempty"`
 
529
 
 
530
        // Id: Identifier uniquely identifying this tax in a response. Not
 
531
        // present for unnamed carrier surcharges.
 
532
        Id string `json:"id,omitempty"`
 
533
 
 
534
        // Kind: Identifies this as a tax information object. Value: the fixed
 
535
        // string qpxexpress#taxInfo.
 
536
        Kind string `json:"kind,omitempty"`
 
537
 
 
538
        // SalePrice: The price of the tax in the sales or equivalent currency.
 
539
        SalePrice string `json:"salePrice,omitempty"`
 
540
}
 
541
 
 
542
type TimeOfDayRange struct {
 
543
        // EarliestTime: The earliest time of day in HH:MM format.
 
544
        EarliestTime string `json:"earliestTime,omitempty"`
 
545
 
 
546
        // Kind: Identifies this as a time of day range object, representing two
 
547
        // times in a single day defining a time range. Value: the fixed string
 
548
        // qpxexpress#timeOfDayRange.
 
549
        Kind string `json:"kind,omitempty"`
 
550
 
 
551
        // LatestTime: The latest time of day in HH:MM format.
 
552
        LatestTime string `json:"latestTime,omitempty"`
 
553
}
 
554
 
 
555
type TripOption struct {
 
556
        // Id: Identifier uniquely identifying this trip in a response.
 
557
        Id string `json:"id,omitempty"`
 
558
 
 
559
        // Kind: Identifies this as a trip information object. Value: the fixed
 
560
        // string qpxexpress#tripOption.
 
561
        Kind string `json:"kind,omitempty"`
 
562
 
 
563
        // Pricing: Per passenger pricing information.
 
564
        Pricing []*PricingInfo `json:"pricing,omitempty"`
 
565
 
 
566
        // SaleTotal: The total price for all passengers on the trip, in the
 
567
        // form of a currency followed by an amount, e.g. USD253.35.
 
568
        SaleTotal string `json:"saleTotal,omitempty"`
 
569
 
 
570
        // Slice: The slices that make up this trip's itinerary.
 
571
        Slice []*SliceInfo `json:"slice,omitempty"`
 
572
}
 
573
 
 
574
type TripOptionsRequest struct {
 
575
        // MaxPrice: Do not return solutions that cost more than this price. The
 
576
        // alphabetical part of the price is in ISO 4217. The format, in regex,
 
577
        // is [A-Z]{3}\d+(\.\d+)? Example: $102.07
 
578
        MaxPrice string `json:"maxPrice,omitempty"`
 
579
 
 
580
        // Passengers: Counts for each passenger type in the request.
 
581
        Passengers *PassengerCounts `json:"passengers,omitempty"`
 
582
 
 
583
        // Refundable: Return only solutions with refundable fares.
 
584
        Refundable bool `json:"refundable,omitempty"`
 
585
 
 
586
        // SaleCountry: IATA country code representing the point of sale. This
 
587
        // determines the "equivalent amount paid" currency for the ticket.
 
588
        SaleCountry string `json:"saleCountry,omitempty"`
 
589
 
 
590
        // Slice: The slices that make up the itinerary of this trip. A slice
 
591
        // represents a traveler's intent, the portion of a low-fare search
 
592
        // corresponding to a traveler's request to get between two points.
 
593
        // One-way journeys are generally expressed using one slice, round-trips
 
594
        // using two. An example of a one slice trip with three segments might
 
595
        // be BOS-SYD, SYD-LAX, LAX-BOS if the traveler only stopped in SYD and
 
596
        // LAX just long enough to change planes.
 
597
        Slice []*SliceInput `json:"slice,omitempty"`
 
598
 
 
599
        // Solutions: The number of solutions to return, maximum 500.
 
600
        Solutions int64 `json:"solutions,omitempty"`
 
601
}
 
602
 
 
603
type TripOptionsResponse struct {
 
604
        // Data: Informational data global to list of solutions.
 
605
        Data *Data `json:"data,omitempty"`
 
606
 
 
607
        // Kind: Identifies this as a QPX Express trip response object, which
 
608
        // consists of zero or more solutions. Value: the fixed string
 
609
        // qpxexpress#tripOptions.
 
610
        Kind string `json:"kind,omitempty"`
 
611
 
 
612
        // RequestId: An identifier uniquely identifying this response.
 
613
        RequestId string `json:"requestId,omitempty"`
 
614
 
 
615
        // TripOption: A list of priced itinerary solutions to the QPX Express
 
616
        // query.
 
617
        TripOption []*TripOption `json:"tripOption,omitempty"`
 
618
}
 
619
 
 
620
type TripsSearchRequest struct {
 
621
        // Request: A QPX Express search request. Required values are at least
 
622
        // one adult or senior passenger, an origin, a destination, and a date.
 
623
        Request *TripOptionsRequest `json:"request,omitempty"`
 
624
}
 
625
 
 
626
type TripsSearchResponse struct {
 
627
        // Kind: Identifies this as a QPX Express API search response resource.
 
628
        // Value: the fixed string qpxExpress#tripsSearch.
 
629
        Kind string `json:"kind,omitempty"`
 
630
 
 
631
        // Trips: All possible solutions to the QPX Express search request.
 
632
        Trips *TripOptionsResponse `json:"trips,omitempty"`
 
633
}
 
634
 
 
635
// method id "qpxExpress.trips.search":
 
636
 
 
637
type TripsSearchCall struct {
 
638
        s                  *Service
 
639
        tripssearchrequest *TripsSearchRequest
 
640
        opt_               map[string]interface{}
 
641
}
 
642
 
 
643
// Search: Returns a list of flights.
 
644
func (r *TripsService) Search(tripssearchrequest *TripsSearchRequest) *TripsSearchCall {
 
645
        c := &TripsSearchCall{s: r.s, opt_: make(map[string]interface{})}
 
646
        c.tripssearchrequest = tripssearchrequest
 
647
        return c
 
648
}
 
649
 
 
650
// Fields allows partial responses to be retrieved.
 
651
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
652
// for more information.
 
653
func (c *TripsSearchCall) Fields(s ...googleapi.Field) *TripsSearchCall {
 
654
        c.opt_["fields"] = googleapi.CombineFields(s)
 
655
        return c
 
656
}
 
657
 
 
658
func (c *TripsSearchCall) Do() (*TripsSearchResponse, error) {
 
659
        var body io.Reader = nil
 
660
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.tripssearchrequest)
 
661
        if err != nil {
 
662
                return nil, err
 
663
        }
 
664
        ctype := "application/json"
 
665
        params := make(url.Values)
 
666
        params.Set("alt", "json")
 
667
        if v, ok := c.opt_["fields"]; ok {
 
668
                params.Set("fields", fmt.Sprintf("%v", v))
 
669
        }
 
670
        urls := googleapi.ResolveRelative(c.s.BasePath, "search")
 
671
        urls += "?" + params.Encode()
 
672
        req, _ := http.NewRequest("POST", urls, body)
 
673
        googleapi.SetOpaque(req.URL)
 
674
        req.Header.Set("Content-Type", ctype)
 
675
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
676
        res, err := c.s.client.Do(req)
 
677
        if err != nil {
 
678
                return nil, err
 
679
        }
 
680
        defer googleapi.CloseBody(res)
 
681
        if err := googleapi.CheckResponse(res); err != nil {
 
682
                return nil, err
 
683
        }
 
684
        var ret *TripsSearchResponse
 
685
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
686
                return nil, err
 
687
        }
 
688
        return ret, nil
 
689
        // {
 
690
        //   "description": "Returns a list of flights.",
 
691
        //   "httpMethod": "POST",
 
692
        //   "id": "qpxExpress.trips.search",
 
693
        //   "path": "search",
 
694
        //   "request": {
 
695
        //     "$ref": "TripsSearchRequest"
 
696
        //   },
 
697
        //   "response": {
 
698
        //     "$ref": "TripsSearchResponse"
 
699
        //   }
 
700
        // }
 
701
 
 
702
}