"use strict"; /** * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* jshint maxlen: false */ const apirequest_1 = require("../../lib/apirequest"); /** * QPX Express API * * Finds the least expensive flights between an origin and a destination. * * @example * const google = require('googleapis'); * const qpxExpress = google.qpxExpress('v1'); * * @namespace qpxExpress * @type {Function} * @version v1 * @variation v1 * @param {object=} options Options for Qpxexpress */ function Qpxexpress(options) { const self = this; self._options = options || {}; self.trips = { /** * qpxExpress.trips.search * * @desc Returns a list of flights. * * @alias qpxExpress.trips.search * @memberOf! qpxExpress(v1) * * @param {object} params Parameters for request * @param {qpxExpress(v1).TripsSearchRequest} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ search: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign({ url: (rootUrl + '/qpxExpress/v1/trips/search').replace(/([^:]\/)\/+/g, '$1'), method: 'POST' }, options), params: params, requiredParams: [], pathParams: [], context: self }; return apirequest_1.default(parameters, callback); } }; } module.exports = Qpxexpress; //# sourceMappingURL=v1.js.map