text: "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.
   */
  Object.defineProperty(exports, "__esModule", { value: true });
  var apirequest_1 = require("../../lib/apirequest");
  // TODO: We will eventually get the `any` in here cleared out, but in the
  // interim we want to turn on no-implicit-any.
  // tslint:disable: no-any
  // tslint:disable: class-name
  // tslint:disable: variable-name
  // tslint:disable: jsdoc-format
  /**
   * Dialogflow API
   *
   * An end-to-end development suite for conversational interfaces (e.g.,
   * chatbots, voice-powered apps and devices).
   *
   * @example
   * const google = require('googleapis');
   * const dialogflow = google.dialogflow('v2');
   *
   * @namespace dialogflow
   * @type {Function}
   * @version v2
   * @variation v2
   * @param {object=} options Options for Dialogflow
   */
  var Dialogflow = /** @class */ (function () {
      function Dialogflow(options, google) {
          this.root = this;
          this._options = options || {};
          this.google = google;
          this.getRoot.bind(this);
          this.projects = new Resource$Projects(this);
      }
      Dialogflow.prototype.getRoot = function () {
          return this.root;
      };
      return Dialogflow;
  }());
  exports.Dialogflow = Dialogflow;
  var Resource$Projects = /** @class */ (function () {
      function Resource$Projects(root) {
          this.root = root;
          this.getRoot.bind(this);
          this.agent = new Resource$Projects$Agent(root);
          this.operations = new Resource$Projects$Operations(root);
      }
      Resource$Projects.prototype.getRoot = function () {
          return this.root;
      };
      Resource$Projects.prototype.getAgent = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/agent').replace(/([^:]\/)\/+/g, '$1'),
                  method: 'GET'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      return Resource$Projects;
  }());
  exports.Resource$Projects = Resource$Projects;
  var Resource$Projects$Agent = /** @class */ (function () {
      function Resource$Projects$Agent(root) {
          this.root = root;
          this.getRoot.bind(this);
          this.entityTypes = new Resource$Projects$Agent$Entitytypes(root);
          this.intents = new Resource$Projects$Agent$Intents(root);
          this.sessions = new Resource$Projects$Agent$Sessions(root);
      }
      Resource$Projects$Agent.prototype.getRoot = function () {
          return this.root;
      };
      Resource$Projects$Agent.prototype.export = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/agent:export')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'POST'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent.prototype.import = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = { options: Object.assign({ url: (rootUrl + '/v2/{parent}/agent:import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST' }, options), params: params, requiredParams: ['parent'], pathParams: ['parent'], context: this.getRoot() };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent.prototype.restore = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/agent:restore')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'POST'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent.prototype.search = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/agent:search')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'GET'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent.prototype.train = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/agent:train')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'POST'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      return Resource$Projects$Agent;
  }());
  exports.Resource$Projects$Agent = Resource$Projects$Agent;
  var Resource$Projects$Agent$Entitytypes = /** @class */ (function () {
      function Resource$Projects$Agent$Entitytypes(root) {
          this.root = root;
          this.getRoot.bind(this);
          this.entities = new Resource$Projects$Agent$Entitytypes$Entities(root);
      }
      Resource$Projects$Agent$Entitytypes.prototype.getRoot = function () {
          return this.root;
      };
      Resource$Projects$Agent$Entitytypes.prototype.batchDelete = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/entityTypes:batchDelete')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'POST'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Entitytypes.prototype.batchUpdate = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/entityTypes:batchUpdate')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'POST'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Entitytypes.prototype.create = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/entityTypes')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'POST'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Entitytypes.prototype.delete = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{name}').replace(/([^:]\/)\/+/g, '$1'),
                  method: 'DELETE'
              }, options),
              params: params,
              requiredParams: ['name'],
              pathParams: ['name'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Entitytypes.prototype.get = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{name}').replace(/([^:]\/)\/+/g, '$1'),
                  method: 'GET'
              }, options),
              params: params,
              requiredParams: ['name'],
              pathParams: ['name'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Entitytypes.prototype.list = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/entityTypes')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'GET'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Entitytypes.prototype.patch = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{name}').replace(/([^:]\/)\/+/g, '$1'),
                  method: 'PATCH'
              }, options),
              params: params,
              requiredParams: ['name'],
              pathParams: ['name'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      return Resource$Projects$Agent$Entitytypes;
  }());
  exports.Resource$Projects$Agent$Entitytypes = Resource$Projects$Agent$Entitytypes;
  var Resource$Projects$Agent$Entitytypes$Entities = /** @class */ (function () {
      function Resource$Projects$Agent$Entitytypes$Entities(root) {
          this.root = root;
          this.getRoot.bind(this);
      }
      Resource$Projects$Agent$Entitytypes$Entities.prototype.getRoot = function () {
          return this.root;
      };
      Resource$Projects$Agent$Entitytypes$Entities.prototype.batchCreate = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/entities:batchCreate')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'POST'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Entitytypes$Entities.prototype.batchDelete = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/entities:batchDelete')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'POST'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Entitytypes$Entities.prototype.batchUpdate = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/entities:batchUpdate')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'POST'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      return Resource$Projects$Agent$Entitytypes$Entities;
  }());
  exports.Resource$Projects$Agent$Entitytypes$Entities = Resource$Projects$Agent$Entitytypes$Entities;
  var Resource$Projects$Agent$Intents = /** @class */ (function () {
      function Resource$Projects$Agent$Intents(root) {
          this.root = root;
          this.getRoot.bind(this);
      }
      Resource$Projects$Agent$Intents.prototype.getRoot = function () {
          return this.root;
      };
      Resource$Projects$Agent$Intents.prototype.batchDelete = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/intents:batchDelete')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'POST'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Intents.prototype.batchUpdate = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/intents:batchUpdate')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'POST'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Intents.prototype.create = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/intents')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'POST'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Intents.prototype.delete = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{name}').replace(/([^:]\/)\/+/g, '$1'),
                  method: 'DELETE'
              }, options),
              params: params,
              requiredParams: ['name'],
              pathParams: ['name'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Intents.prototype.get = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{name}').replace(/([^:]\/)\/+/g, '$1'),
                  method: 'GET'
              }, options),
              params: params,
              requiredParams: ['name'],
              pathParams: ['name'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Intents.prototype.list = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/intents')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'GET'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Intents.prototype.patch = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{name}').replace(/([^:]\/)\/+/g, '$1'),
                  method: 'PATCH'
              }, options),
              params: params,
              requiredParams: ['name'],
              pathParams: ['name'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      return Resource$Projects$Agent$Intents;
  }());
  exports.Resource$Projects$Agent$Intents = Resource$Projects$Agent$Intents;
  var Resource$Projects$Agent$Sessions = /** @class */ (function () {
      function Resource$Projects$Agent$Sessions(root) {
          this.root = root;
          this.getRoot.bind(this);
          this.contexts = new Resource$Projects$Agent$Sessions$Contexts(root);
          this.entityTypes = new Resource$Projects$Agent$Sessions$Entitytypes(root);
      }
      Resource$Projects$Agent$Sessions.prototype.getRoot = function () {
          return this.root;
      };
      Resource$Projects$Agent$Sessions.prototype.deleteContexts = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/contexts')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'DELETE'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Sessions.prototype.detectIntent = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{session}:detectIntent')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'POST'
              }, options),
              params: params,
              requiredParams: ['session'],
              pathParams: ['session'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      return Resource$Projects$Agent$Sessions;
  }());
  exports.Resource$Projects$Agent$Sessions = Resource$Projects$Agent$Sessions;
  var Resource$Projects$Agent$Sessions$Contexts = /** @class */ (function () {
      function Resource$Projects$Agent$Sessions$Contexts(root) {
          this.root = root;
          this.getRoot.bind(this);
      }
      Resource$Projects$Agent$Sessions$Contexts.prototype.getRoot = function () {
          return this.root;
      };
      Resource$Projects$Agent$Sessions$Contexts.prototype.create = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/contexts')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'POST'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Sessions$Contexts.prototype.delete = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{name}').replace(/([^:]\/)\/+/g, '$1'),
                  method: 'DELETE'
              }, options),
              params: params,
              requiredParams: ['name'],
              pathParams: ['name'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Sessions$Contexts.prototype.get = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{name}').replace(/([^:]\/)\/+/g, '$1'),
                  method: 'GET'
              }, options),
              params: params,
              requiredParams: ['name'],
              pathParams: ['name'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Sessions$Contexts.prototype.list = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/contexts')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'GET'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Sessions$Contexts.prototype.patch = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{name}').replace(/([^:]\/)\/+/g, '$1'),
                  method: 'PATCH'
              }, options),
              params: params,
              requiredParams: ['name'],
              pathParams: ['name'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      return Resource$Projects$Agent$Sessions$Contexts;
  }());
  exports.Resource$Projects$Agent$Sessions$Contexts = Resource$Projects$Agent$Sessions$Contexts;
  var Resource$Projects$Agent$Sessions$Entitytypes = /** @class */ (function () {
      function Resource$Projects$Agent$Sessions$Entitytypes(root) {
          this.root = root;
          this.getRoot.bind(this);
      }
      Resource$Projects$Agent$Sessions$Entitytypes.prototype.getRoot = function () {
          return this.root;
      };
      Resource$Projects$Agent$Sessions$Entitytypes.prototype.create = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/entityTypes')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'POST'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Sessions$Entitytypes.prototype.delete = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{name}').replace(/([^:]\/)\/+/g, '$1'),
                  method: 'DELETE'
              }, options),
              params: params,
              requiredParams: ['name'],
              pathParams: ['name'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Sessions$Entitytypes.prototype.get = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{name}').replace(/([^:]\/)\/+/g, '$1'),
                  method: 'GET'
              }, options),
              params: params,
              requiredParams: ['name'],
              pathParams: ['name'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Sessions$Entitytypes.prototype.list = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{parent}/entityTypes')
                      .replace(/([^:]\/)\/+/g, '$1'),
                  method: 'GET'
              }, options),
              params: params,
              requiredParams: ['parent'],
              pathParams: ['parent'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      Resource$Projects$Agent$Sessions$Entitytypes.prototype.patch = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{name}').replace(/([^:]\/)\/+/g, '$1'),
                  method: 'PATCH'
              }, options),
              params: params,
              requiredParams: ['name'],
              pathParams: ['name'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      return Resource$Projects$Agent$Sessions$Entitytypes;
  }());
  exports.Resource$Projects$Agent$Sessions$Entitytypes = Resource$Projects$Agent$Sessions$Entitytypes;
  var Resource$Projects$Operations = /** @class */ (function () {
      function Resource$Projects$Operations(root) {
          this.root = root;
          this.getRoot.bind(this);
      }
      Resource$Projects$Operations.prototype.getRoot = function () {
          return this.root;
      };
      Resource$Projects$Operations.prototype.get = function (params, options, callback) {
          if (typeof options === 'function') {
              callback = options;
              options = {};
          }
          if (typeof params === 'function') {
              callback = params;
              params = {};
          }
          options = options || {};
          var rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/';
          var parameters = {
              options: Object.assign({
                  url: (rootUrl + '/v2/{name}').replace(/([^:]\/)\/+/g, '$1'),
                  method: 'GET'
              }, options),
              params: params,
              requiredParams: ['name'],
              pathParams: ['name'],
              context: this.getRoot()
          };
          if (callback) {
              apirequest_1.createAPIRequest(parameters, callback);
          }
          else {
              return apirequest_1.createAPIRequest(parameters);
          }
      };
      return Resource$Projects$Operations;
  }());
  exports.Resource$Projects$Operations = Resource$Projects$Operations;
  //# sourceMappingURL=v2.js.map