diff --git a/src/apis/dialogflow/v3.ts b/src/apis/dialogflow/v3.ts index dfe9e0173fc..d0de176524a 100644 --- a/src/apis/dialogflow/v3.ts +++ b/src/apis/dialogflow/v3.ts @@ -34,6 +34,12 @@ import { APIRequestContext, } from 'googleapis-common'; import {Readable} from 'stream'; +import { + validateSingleSegment, + validateMultiSegment, + encodeWithSlashes, + encodeWithoutSlashes, +} from '../../transcoding'; export namespace dialogflow_v3 { export interface Options extends GlobalOptions { @@ -3784,11 +3790,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -3936,14 +3949,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}/locations').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+name}/locations') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -4215,14 +4232,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/agents').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/agents') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -4353,11 +4374,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -4507,11 +4535,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}:export').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}:export') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -4669,11 +4704,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -4822,11 +4864,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -4971,11 +5020,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -5121,14 +5177,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/agents').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/agents') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -5321,11 +5381,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -5476,14 +5543,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}:restore').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+name}:restore') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -5644,11 +5715,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -5798,14 +5876,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}:validate').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+name}:validate') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -6081,11 +6163,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -6234,14 +6323,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/changelogs').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/changelogs') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -6439,14 +6532,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/entityTypes').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/entityTypes') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -6580,11 +6677,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -6735,14 +6839,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/entityTypes:export').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/entityTypes:export') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -6891,11 +6999,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -7047,14 +7162,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/entityTypes:import').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/entityTypes:import') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -7201,14 +7320,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/entityTypes').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/entityTypes') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -7376,11 +7499,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -7657,14 +7787,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/environments').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/environments') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -7794,11 +7928,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -7947,14 +8088,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.environment !== undefined && params.environment !== null) { + validateMultiSegment('environment', String(params.environment)); + params.environment = encodeWithoutSlashes(String(params.environment)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+environment}:deployFlow').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+environment}:deployFlow') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -8100,11 +8245,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -8251,14 +8403,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/environments').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/environments') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -8408,14 +8564,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}:lookupEnvironmentHistory').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+name}:lookupEnvironmentHistory') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -8572,11 +8732,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -8723,14 +8890,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.environment !== undefined && params.environment !== null) { + validateMultiSegment('environment', String(params.environment)); + params.environment = encodeWithoutSlashes(String(params.environment)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+environment}:runContinuousTest').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+environment}:runContinuousTest') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -8975,14 +9146,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/continuousTestResults').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/continuousTestResults') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -9152,11 +9327,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -9305,14 +9487,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/deployments').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/deployments') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -9520,14 +9706,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/experiments').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/experiments') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -9660,11 +9850,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -9819,11 +10016,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -9972,14 +10176,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/experiments').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/experiments') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -10160,11 +10368,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -10327,11 +10542,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}:start').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}:start') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -10494,11 +10716,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}:stop').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}:stop') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -10747,14 +10976,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.session !== undefined && params.session !== null) { + validateMultiSegment('session', String(params.session)); + params.session = encodeWithoutSlashes(String(params.session)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+session}:detectIntent').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+session}:detectIntent') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -10913,14 +11146,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.session !== undefined && params.session !== null) { + validateMultiSegment('session', String(params.session)); + params.session = encodeWithoutSlashes(String(params.session)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+session}:fulfillIntent').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+session}:fulfillIntent') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -11081,14 +11318,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.session !== undefined && params.session !== null) { + validateMultiSegment('session', String(params.session)); + params.session = encodeWithoutSlashes(String(params.session)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+session}:matchIntent').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+session}:matchIntent') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -11250,13 +11491,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.session !== undefined && params.session !== null) { + validateMultiSegment('session', String(params.session)); + params.session = encodeWithoutSlashes(String(params.session)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/v3/{+session}:serverStreamingDetectIntent' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+session}:serverStreamingDetectIntent') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -11466,14 +11712,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/entityTypes').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/entityTypes') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -11608,11 +11858,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -11757,11 +12014,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -11912,14 +12176,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/entityTypes').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/entityTypes') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -12078,11 +12346,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -12326,14 +12601,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/flows').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/flows') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -12466,11 +12745,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -12617,11 +12903,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}:export').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}:export') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -12770,11 +13063,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -12921,11 +13221,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -13076,14 +13383,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/flows:import').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/flows:import') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -13229,14 +13540,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/flows').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/flows') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -13409,11 +13724,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -13559,11 +13881,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}:train').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}:train') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -13712,14 +14041,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}:validate').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+name}:validate') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -14020,14 +14353,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/pages').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/pages') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -14161,11 +14498,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -14312,11 +14656,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -14466,14 +14817,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/pages').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/pages') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -14641,11 +14996,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -14885,14 +15247,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/transitionRouteGroups').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/transitionRouteGroups') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -15029,11 +15395,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -15178,11 +15551,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -15335,14 +15715,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/transitionRouteGroups').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/transitionRouteGroups') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -15503,11 +15887,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -15742,14 +16133,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.baseVersion !== undefined && params.baseVersion !== null) { + validateMultiSegment('baseVersion', String(params.baseVersion)); + params.baseVersion = encodeWithoutSlashes(String(params.baseVersion)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+baseVersion}:compareVersions').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+baseVersion}:compareVersions') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -15904,14 +16299,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/versions').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/versions') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -16041,11 +16440,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -16190,11 +16596,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -16342,14 +16755,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/versions').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/versions') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -16498,11 +16915,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}:load').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}:load') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -16662,11 +17086,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -16910,14 +17341,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/generators').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/generators') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -17051,11 +17486,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -17201,11 +17643,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -17354,14 +17803,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/generators').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/generators') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -17525,11 +17978,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -17772,14 +18232,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/intents').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/intents') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -17910,11 +18374,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -18063,14 +18534,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/intents:export').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/intents:export') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -18215,11 +18690,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -18369,14 +18851,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/intents:import').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/intents:import') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -18524,14 +19010,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/intents').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/intents') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -18696,11 +19186,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -18992,14 +19489,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/playbooks').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/playbooks') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -19131,11 +19632,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -19283,11 +19791,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}:export').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}:export') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -19442,11 +19957,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -19597,14 +20119,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/playbooks:import').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/playbooks:import') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -19748,14 +20274,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/playbooks').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/playbooks') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -19939,11 +20469,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -20197,14 +20734,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/examples').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/examples') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -20337,11 +20878,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -20493,11 +21041,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -20648,14 +21203,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/examples').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/examples') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -20828,11 +21387,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -21056,14 +21622,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/versions').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/versions') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -21196,11 +21766,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -21346,11 +21923,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -21499,14 +22083,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/versions').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/versions') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -21655,14 +22243,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}:restore').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+name}:restore') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -21882,14 +22474,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.session !== undefined && params.session !== null) { + validateMultiSegment('session', String(params.session)); + params.session = encodeWithoutSlashes(String(params.session)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+session}:detectIntent').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+session}:detectIntent') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -22047,14 +22643,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.session !== undefined && params.session !== null) { + validateMultiSegment('session', String(params.session)); + params.session = encodeWithoutSlashes(String(params.session)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+session}:fulfillIntent').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+session}:fulfillIntent') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -22212,14 +22812,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.session !== undefined && params.session !== null) { + validateMultiSegment('session', String(params.session)); + params.session = encodeWithoutSlashes(String(params.session)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+session}:matchIntent').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+session}:matchIntent') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -22381,13 +22985,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.session !== undefined && params.session !== null) { + validateMultiSegment('session', String(params.session)); + params.session = encodeWithoutSlashes(String(params.session)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/v3/{+session}:serverStreamingDetectIntent' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+session}:serverStreamingDetectIntent') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -22543,14 +23152,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.session !== undefined && params.session !== null) { + validateMultiSegment('session', String(params.session)); + params.session = encodeWithoutSlashes(String(params.session)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+session}:submitAnswerFeedback').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+session}:submitAnswerFeedback') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -22769,14 +23382,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/entityTypes').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/entityTypes') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -22909,11 +23526,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -23056,11 +23680,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -23209,14 +23840,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/entityTypes').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/entityTypes') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -23373,11 +24008,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -23583,14 +24225,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/testCases:batchDelete').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/testCases:batchDelete') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -23738,14 +24384,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/testCases:batchRun').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/testCases:batchRun') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -23891,14 +24541,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.agent !== undefined && params.agent !== null) { + validateMultiSegment('agent', String(params.agent)); + params.agent = encodeWithoutSlashes(String(params.agent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+agent}/testCases:calculateCoverage').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+agent}/testCases:calculateCoverage') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -24062,14 +24716,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/testCases').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/testCases') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -24220,14 +24878,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/testCases:export').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/testCases:export') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -24373,11 +25035,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -24527,14 +25196,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/testCases:import').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/testCases:import') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -24680,14 +25353,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/testCases').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/testCases') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -24853,11 +25530,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -25005,11 +25689,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}:run').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}:run') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -25276,11 +25967,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -25432,14 +26130,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/results').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/results') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -25632,14 +26334,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/tools').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/tools') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -25772,11 +26478,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -25917,11 +26630,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -26067,14 +26787,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/tools').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/tools') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -26233,11 +26957,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -26460,14 +27191,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/versions').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/versions') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -26601,11 +27336,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -26749,11 +27491,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -26901,14 +27650,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/versions').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/versions') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -27058,14 +27811,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}:restore').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+name}:restore') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -27282,14 +28039,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/transitionRouteGroups').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/transitionRouteGroups') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -27424,11 +28185,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -27573,11 +28341,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -27727,14 +28502,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/transitionRouteGroups').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/transitionRouteGroups') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -27893,11 +28672,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -28137,14 +28923,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/webhooks').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/webhooks') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -28278,11 +29068,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -28426,11 +29223,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -28576,14 +29380,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/webhooks').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/webhooks') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -28744,11 +29552,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -28943,11 +29758,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -29085,11 +29907,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -29238,14 +30067,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}/operations').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+name}/operations') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -29457,14 +30290,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/securitySettings').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/securitySettings') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -29596,11 +30433,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -29749,11 +30593,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -29899,14 +30750,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.parent !== undefined && params.parent !== null) { + validateMultiSegment('parent', String(params.parent)); + params.parent = encodeWithoutSlashes(String(params.parent)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+parent}/securitySettings').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+parent}/securitySettings') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -30078,11 +30933,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -30273,11 +31135,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -30415,11 +31284,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v3/{+name}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -30568,14 +31444,18 @@ export namespace dialogflow_v3 { options = {}; } + if (params.name !== undefined && params.name !== null) { + validateMultiSegment('name', String(params.name)); + params.name = encodeWithoutSlashes(String(params.name)); + } + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/v3/{+name}/operations').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v3/{+name}/operations') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, diff --git a/src/apis/drive/v2.ts b/src/apis/drive/v2.ts index dfd61d8aec6..c871f30b27c 100644 --- a/src/apis/drive/v2.ts +++ b/src/apis/drive/v2.ts @@ -34,6 +34,12 @@ import { APIRequestContext, } from 'googleapis-common'; import {Readable} from 'stream'; +import { + validateSingleSegment, + validateMultiSegment, + encodeWithSlashes, + encodeWithoutSlashes, +} from '../../transcoding'; export namespace drive_v2 { export interface Options extends GlobalOptions { @@ -2196,7 +2202,9 @@ export namespace drive_v2 { const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/about').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/about') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -2377,14 +2385,18 @@ export namespace drive_v2 { options = {}; } + if (params.appId !== undefined && params.appId !== null) { + validateSingleSegment('appId', String(params.appId)); + params.appId = encodeWithSlashes(String(params.appId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/apps/{appId}').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/apps/{appId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -2524,7 +2536,9 @@ export namespace drive_v2 { const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/apps').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/apps') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -2710,14 +2724,18 @@ export namespace drive_v2 { options = {}; } + if (params.changeId !== undefined && params.changeId !== null) { + validateSingleSegment('changeId', String(params.changeId)); + params.changeId = encodeWithSlashes(String(params.changeId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/changes/{changeId}').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/changes/{changeId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -2870,10 +2888,9 @@ export namespace drive_v2 { const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/changes/startPageToken').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/changes/startPageToken') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -3050,7 +3067,9 @@ export namespace drive_v2 { const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/changes').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/changes') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -3246,10 +3265,9 @@ export namespace drive_v2 { const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/changes/watch').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/changes/watch') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -3576,10 +3594,9 @@ export namespace drive_v2 { const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/channels/stop').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/channels/stop') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -3722,13 +3739,22 @@ export namespace drive_v2 { options = {}; } + if (params.childId !== undefined && params.childId !== null) { + validateSingleSegment('childId', String(params.childId)); + params.childId = encodeWithSlashes(String(params.childId)); + } + if (params.folderId !== undefined && params.folderId !== null) { + validateSingleSegment('folderId', String(params.folderId)); + params.folderId = encodeWithSlashes(String(params.folderId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/drive/v2/files/{folderId}/children/{childId}' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files/{folderId}/children/{childId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -3871,13 +3897,22 @@ export namespace drive_v2 { options = {}; } + if (params.childId !== undefined && params.childId !== null) { + validateSingleSegment('childId', String(params.childId)); + params.childId = encodeWithSlashes(String(params.childId)); + } + if (params.folderId !== undefined && params.folderId !== null) { + validateSingleSegment('folderId', String(params.folderId)); + params.folderId = encodeWithSlashes(String(params.folderId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/drive/v2/files/{folderId}/children/{childId}' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files/{folderId}/children/{childId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -4030,14 +4065,18 @@ export namespace drive_v2 { options = {}; } + if (params.folderId !== undefined && params.folderId !== null) { + validateSingleSegment('folderId', String(params.folderId)); + params.folderId = encodeWithSlashes(String(params.folderId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{folderId}/children').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{folderId}/children') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -4187,14 +4226,18 @@ export namespace drive_v2 { options = {}; } + if (params.folderId !== undefined && params.folderId !== null) { + validateSingleSegment('folderId', String(params.folderId)); + params.folderId = encodeWithSlashes(String(params.folderId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{folderId}/children').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{folderId}/children') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -4398,13 +4441,22 @@ export namespace drive_v2 { options = {}; } + if (params.commentId !== undefined && params.commentId !== null) { + validateSingleSegment('commentId', String(params.commentId)); + params.commentId = encodeWithSlashes(String(params.commentId)); + } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -4555,13 +4607,22 @@ export namespace drive_v2 { options = {}; } + if (params.commentId !== undefined && params.commentId !== null) { + validateSingleSegment('commentId', String(params.commentId)); + params.commentId = encodeWithSlashes(String(params.commentId)); + } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -4728,14 +4789,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}/comments').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}/comments') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -4881,14 +4946,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}/comments').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}/comments') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -5057,13 +5126,22 @@ export namespace drive_v2 { options = {}; } + if (params.commentId !== undefined && params.commentId !== null) { + validateSingleSegment('commentId', String(params.commentId)); + params.commentId = encodeWithSlashes(String(params.commentId)); + } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -5232,13 +5310,22 @@ export namespace drive_v2 { options = {}; } + if (params.commentId !== undefined && params.commentId !== null) { + validateSingleSegment('commentId', String(params.commentId)); + params.commentId = encodeWithSlashes(String(params.commentId)); + } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PUT', apiVersion: '', }, @@ -5459,14 +5546,18 @@ export namespace drive_v2 { options = {}; } + if (params.driveId !== undefined && params.driveId !== null) { + validateSingleSegment('driveId', String(params.driveId)); + params.driveId = encodeWithSlashes(String(params.driveId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/drives/{driveId}').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/drives/{driveId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -5610,14 +5701,18 @@ export namespace drive_v2 { options = {}; } + if (params.driveId !== undefined && params.driveId !== null) { + validateSingleSegment('driveId', String(params.driveId)); + params.driveId = encodeWithSlashes(String(params.driveId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/drives/{driveId}').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/drives/{driveId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -5756,14 +5851,18 @@ export namespace drive_v2 { options = {}; } + if (params.driveId !== undefined && params.driveId !== null) { + validateSingleSegment('driveId', String(params.driveId)); + params.driveId = encodeWithSlashes(String(params.driveId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/drives/{driveId}/hide').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/drives/{driveId}/hide') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -5925,7 +6024,9 @@ export namespace drive_v2 { const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/drives').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/drives') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -6068,7 +6169,9 @@ export namespace drive_v2 { const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/drives').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/drives') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -6207,14 +6310,18 @@ export namespace drive_v2 { options = {}; } + if (params.driveId !== undefined && params.driveId !== null) { + validateSingleSegment('driveId', String(params.driveId)); + params.driveId = encodeWithSlashes(String(params.driveId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/drives/{driveId}/unhide').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/drives/{driveId}/unhide') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -6374,14 +6481,18 @@ export namespace drive_v2 { options = {}; } + if (params.driveId !== undefined && params.driveId !== null) { + validateSingleSegment('driveId', String(params.driveId)); + params.driveId = encodeWithSlashes(String(params.driveId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/drives/{driveId}').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/drives/{driveId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PUT', apiVersion: '', }, @@ -6787,14 +6898,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}/copy').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}/copy') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -6926,14 +7041,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -7061,10 +7180,9 @@ export namespace drive_v2 { const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/trash').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/trash') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -7193,14 +7311,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}/export').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}/export') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -7343,10 +7465,9 @@ export namespace drive_v2 { const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/generateCseToken').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/generateCseToken') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -7490,10 +7611,9 @@ export namespace drive_v2 { const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/generateIds').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/generateIds') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -7722,14 +7842,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -8054,17 +8178,18 @@ export namespace drive_v2 { const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, options ), params, - mediaUrl: (rootUrl + '/upload/drive/v2/files').replace( - /([^:]\/)\/+/g, - '$1' - ), + mediaUrl: (rootUrl + '/upload/drive/v2/files') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), requiredParams: [], pathParams: [], context: this.context, @@ -8236,7 +8361,9 @@ export namespace drive_v2 { const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -8377,14 +8504,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}/listLabels').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}/listLabels') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -8531,14 +8662,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}/modifyLabels').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}/modifyLabels') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -8869,14 +9004,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -9094,14 +9233,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}/touch').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}/touch') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -9318,14 +9461,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}/trash').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}/trash') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -9542,14 +9689,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}/untrash').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}/untrash') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -9884,24 +10035,27 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PUT', apiVersion: '', }, options ), params, - mediaUrl: (rootUrl + '/upload/drive/v2/files/{fileId}').replace( - /([^:]\/)\/+/g, - '$1' - ), + mediaUrl: (rootUrl + '/upload/drive/v2/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), requiredParams: ['fileId'], pathParams: ['fileId'], context: this.context, @@ -10074,14 +10228,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}/watch').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}/watch') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -10832,13 +10990,22 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.parentId !== undefined && params.parentId !== null) { + validateSingleSegment('parentId', String(params.parentId)); + params.parentId = encodeWithSlashes(String(params.parentId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/drive/v2/files/{fileId}/parents/{parentId}' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files/{fileId}/parents/{parentId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -10982,13 +11149,22 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.parentId !== undefined && params.parentId !== null) { + validateSingleSegment('parentId', String(params.parentId)); + params.parentId = encodeWithSlashes(String(params.parentId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/drive/v2/files/{fileId}/parents/{parentId}' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files/{fileId}/parents/{parentId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -11143,14 +11319,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}/parents').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}/parents') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -11290,14 +11470,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}/parents').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}/parents') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -11494,13 +11678,24 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.permissionId !== undefined && params.permissionId !== null) { + validateSingleSegment('permissionId', String(params.permissionId)); + params.permissionId = encodeWithSlashes(String(params.permissionId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { url: ( rootUrl + '/drive/v2/files/{fileId}/permissions/{permissionId}' - ).replace(/([^:]\/)\/+/g, '$1'), + ) + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -11664,13 +11859,24 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.permissionId !== undefined && params.permissionId !== null) { + validateSingleSegment('permissionId', String(params.permissionId)); + params.permissionId = encodeWithSlashes(String(params.permissionId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { url: ( rootUrl + '/drive/v2/files/{fileId}/permissions/{permissionId}' - ).replace(/([^:]\/)\/+/g, '$1'), + ) + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -11810,14 +12016,18 @@ export namespace drive_v2 { options = {}; } + if (params.email !== undefined && params.email !== null) { + validateSingleSegment('email', String(params.email)); + params.email = encodeWithSlashes(String(params.email)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/permissionIds/{email}').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/permissionIds/{email}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -12013,14 +12223,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}/permissions').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}/permissions') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -12173,14 +12387,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}/permissions').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}/permissions') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -12374,13 +12592,24 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.permissionId !== undefined && params.permissionId !== null) { + validateSingleSegment('permissionId', String(params.permissionId)); + params.permissionId = encodeWithSlashes(String(params.permissionId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { url: ( rootUrl + '/drive/v2/files/{fileId}/permissions/{permissionId}' - ).replace(/([^:]\/)\/+/g, '$1'), + ) + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -12574,13 +12803,24 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.permissionId !== undefined && params.permissionId !== null) { + validateSingleSegment('permissionId', String(params.permissionId)); + params.permissionId = encodeWithSlashes(String(params.permissionId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { url: ( rootUrl + '/drive/v2/files/{fileId}/permissions/{permissionId}' - ).replace(/([^:]\/)\/+/g, '$1'), + ) + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PUT', apiVersion: '', }, @@ -12925,13 +13165,22 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.propertyKey !== undefined && params.propertyKey !== null) { + validateSingleSegment('propertyKey', String(params.propertyKey)); + params.propertyKey = encodeWithSlashes(String(params.propertyKey)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/drive/v2/files/{fileId}/properties/{propertyKey}' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files/{fileId}/properties/{propertyKey}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -13077,13 +13326,22 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.propertyKey !== undefined && params.propertyKey !== null) { + validateSingleSegment('propertyKey', String(params.propertyKey)); + params.propertyKey = encodeWithSlashes(String(params.propertyKey)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/drive/v2/files/{fileId}/properties/{propertyKey}' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files/{fileId}/properties/{propertyKey}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -13235,14 +13493,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}/properties').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}/properties') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -13383,14 +13645,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}/properties').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}/properties') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -13545,13 +13811,22 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.propertyKey !== undefined && params.propertyKey !== null) { + validateSingleSegment('propertyKey', String(params.propertyKey)); + params.propertyKey = encodeWithSlashes(String(params.propertyKey)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/drive/v2/files/{fileId}/properties/{propertyKey}' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files/{fileId}/properties/{propertyKey}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -13707,13 +13982,22 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.propertyKey !== undefined && params.propertyKey !== null) { + validateSingleSegment('propertyKey', String(params.propertyKey)); + params.propertyKey = encodeWithSlashes(String(params.propertyKey)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/drive/v2/files/{fileId}/properties/{propertyKey}' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files/{fileId}/properties/{propertyKey}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PUT', apiVersion: '', }, @@ -13933,6 +14217,19 @@ export namespace drive_v2 { options = {}; } + if (params.commentId !== undefined && params.commentId !== null) { + validateSingleSegment('commentId', String(params.commentId)); + params.commentId = encodeWithSlashes(String(params.commentId)); + } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.replyId !== undefined && params.replyId !== null) { + validateSingleSegment('replyId', String(params.replyId)); + params.replyId = encodeWithSlashes(String(params.replyId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( @@ -13940,7 +14237,9 @@ export namespace drive_v2 { url: ( rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}' - ).replace(/([^:]\/)\/+/g, '$1'), + ) + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -14088,6 +14387,19 @@ export namespace drive_v2 { options = {}; } + if (params.commentId !== undefined && params.commentId !== null) { + validateSingleSegment('commentId', String(params.commentId)); + params.commentId = encodeWithSlashes(String(params.commentId)); + } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.replyId !== undefined && params.replyId !== null) { + validateSingleSegment('replyId', String(params.replyId)); + params.replyId = encodeWithSlashes(String(params.replyId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( @@ -14095,7 +14407,9 @@ export namespace drive_v2 { url: ( rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}' - ).replace(/([^:]\/)\/+/g, '$1'), + ) + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -14253,13 +14567,24 @@ export namespace drive_v2 { options = {}; } + if (params.commentId !== undefined && params.commentId !== null) { + validateSingleSegment('commentId', String(params.commentId)); + params.commentId = encodeWithSlashes(String(params.commentId)); + } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { url: ( rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}/replies' - ).replace(/([^:]\/)\/+/g, '$1'), + ) + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -14405,13 +14730,24 @@ export namespace drive_v2 { options = {}; } + if (params.commentId !== undefined && params.commentId !== null) { + validateSingleSegment('commentId', String(params.commentId)); + params.commentId = encodeWithSlashes(String(params.commentId)); + } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { url: ( rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}/replies' - ).replace(/([^:]\/)\/+/g, '$1'), + ) + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -14571,6 +14907,19 @@ export namespace drive_v2 { options = {}; } + if (params.commentId !== undefined && params.commentId !== null) { + validateSingleSegment('commentId', String(params.commentId)); + params.commentId = encodeWithSlashes(String(params.commentId)); + } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.replyId !== undefined && params.replyId !== null) { + validateSingleSegment('replyId', String(params.replyId)); + params.replyId = encodeWithSlashes(String(params.replyId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( @@ -14578,7 +14927,9 @@ export namespace drive_v2 { url: ( rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}' - ).replace(/([^:]\/)\/+/g, '$1'), + ) + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -14738,6 +15089,19 @@ export namespace drive_v2 { options = {}; } + if (params.commentId !== undefined && params.commentId !== null) { + validateSingleSegment('commentId', String(params.commentId)); + params.commentId = encodeWithSlashes(String(params.commentId)); + } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.replyId !== undefined && params.replyId !== null) { + validateSingleSegment('replyId', String(params.replyId)); + params.replyId = encodeWithSlashes(String(params.replyId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( @@ -14745,7 +15109,9 @@ export namespace drive_v2 { url: ( rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}' - ).replace(/([^:]\/)\/+/g, '$1'), + ) + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PUT', apiVersion: '', }, @@ -14988,13 +15354,22 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.revisionId !== undefined && params.revisionId !== null) { + validateSingleSegment('revisionId', String(params.revisionId)); + params.revisionId = encodeWithSlashes(String(params.revisionId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/drive/v2/files/{fileId}/revisions/{revisionId}' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files/{fileId}/revisions/{revisionId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -15150,13 +15525,22 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.revisionId !== undefined && params.revisionId !== null) { + validateSingleSegment('revisionId', String(params.revisionId)); + params.revisionId = encodeWithSlashes(String(params.revisionId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/drive/v2/files/{fileId}/revisions/{revisionId}' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files/{fileId}/revisions/{revisionId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -15302,14 +15686,18 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/files/{fileId}/revisions').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/files/{fileId}/revisions') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -15485,13 +15873,22 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.revisionId !== undefined && params.revisionId !== null) { + validateSingleSegment('revisionId', String(params.revisionId)); + params.revisionId = encodeWithSlashes(String(params.revisionId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/drive/v2/files/{fileId}/revisions/{revisionId}' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files/{fileId}/revisions/{revisionId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PATCH', apiVersion: '', }, @@ -15667,13 +16064,22 @@ export namespace drive_v2 { options = {}; } + if (params.fileId !== undefined && params.fileId !== null) { + validateSingleSegment('fileId', String(params.fileId)); + params.fileId = encodeWithSlashes(String(params.fileId)); + } + if (params.revisionId !== undefined && params.revisionId !== null) { + validateSingleSegment('revisionId', String(params.revisionId)); + params.revisionId = encodeWithSlashes(String(params.revisionId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: ( - rootUrl + '/drive/v2/files/{fileId}/revisions/{revisionId}' - ).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/drive/v2/files/{fileId}/revisions/{revisionId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PUT', apiVersion: '', }, @@ -15868,14 +16274,18 @@ export namespace drive_v2 { options = {}; } + if (params.teamDriveId !== undefined && params.teamDriveId !== null) { + validateSingleSegment('teamDriveId', String(params.teamDriveId)); + params.teamDriveId = encodeWithSlashes(String(params.teamDriveId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/teamdrives/{teamDriveId}').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/teamdrives/{teamDriveId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'DELETE', apiVersion: '', }, @@ -16018,14 +16428,18 @@ export namespace drive_v2 { options = {}; } + if (params.teamDriveId !== undefined && params.teamDriveId !== null) { + validateSingleSegment('teamDriveId', String(params.teamDriveId)); + params.teamDriveId = encodeWithSlashes(String(params.teamDriveId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/teamdrives/{teamDriveId}').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/teamdrives/{teamDriveId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -16186,10 +16600,9 @@ export namespace drive_v2 { const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/teamdrives').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/teamdrives') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'POST', apiVersion: '', }, @@ -16333,10 +16746,9 @@ export namespace drive_v2 { const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/teamdrives').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/teamdrives') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'GET', apiVersion: '', }, @@ -16495,14 +16907,18 @@ export namespace drive_v2 { options = {}; } + if (params.teamDriveId !== undefined && params.teamDriveId !== null) { + validateSingleSegment('teamDriveId', String(params.teamDriveId)); + params.teamDriveId = encodeWithSlashes(String(params.teamDriveId)); + } + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign( { - url: (rootUrl + '/drive/v2/teamdrives/{teamDriveId}').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/drive/v2/teamdrives/{teamDriveId}') + .replace(/([^:]\/)\/+/g, '$1') + .replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: 'PUT', apiVersion: '', }, diff --git a/src/generator/filters.ts b/src/generator/filters.ts index 1eeb4f19fea..72d0d9969e7 100644 --- a/src/generator/filters.ts +++ b/src/generator/filters.ts @@ -118,6 +118,21 @@ export function hasResourceParam(method: SchemaMethod): boolean { return !!method.parameters && !!method.parameters['resource']; } +export function isReservedParam( + p: {reserved?: boolean}, + pname: string, + mpath?: string +): boolean { + if (p && p.reserved) { + return true; + } + if (!mpath) { + return false; + } + const regex = new RegExp(`\\{\\+${pname}(?:[\\}:/=]|$)`); + return regex.test(mpath); +} + const RESERVED_PARAMS = ['resource', 'media', 'auth']; /** diff --git a/src/generator/generator.ts b/src/generator/generator.ts index e9daded8679..1c95543a05a 100644 --- a/src/generator/generator.ts +++ b/src/generator/generator.ts @@ -73,6 +73,7 @@ export class Generator { this.env.addFilter('getPathParams', filters.getPathParams); this.env.addFilter('getSafeParamName', filters.getSafeParamName); this.env.addFilter('hasResourceParam', filters.hasResourceParam); + this.env.addFilter('isReservedParam', filters.isReservedParam); } /** diff --git a/src/generator/templates/api-endpoint.njk b/src/generator/templates/api-endpoint.njk index e9c43492906..ea633d67a56 100644 --- a/src/generator/templates/api-endpoint.njk +++ b/src/generator/templates/api-endpoint.njk @@ -27,6 +27,12 @@ import { APIRequestContext, } from 'googleapis-common'; import {Readable} from 'stream'; +import { + validateSingleSegment, + validateMultiSegment, + encodeWithSlashes, + encodeWithoutSlashes, +} from '../../transcoding'; export namespace {{api.name}}_{{api.version|replace('\.', '_')}} { diff --git a/src/generator/templates/method-partial.njk b/src/generator/templates/method-partial.njk index 706b591f6d4..c3b844624a9 100644 --- a/src/generator/templates/method-partial.njk +++ b/src/generator/templates/method-partial.njk @@ -47,15 +47,33 @@ options = {}; } + {% if m.parameters %} + {% for pname, p in m.parameters|dictsort %} + {% if p.location == 'path' %} + {% set safePName = pname|getSafeParamName %} + {% set isReserved = p|isReservedParam(pname, m.path) %} + if (params.{{ safePName }} !== undefined && params.{{ safePName }} !== null) { + {% if isReserved %} + validateMultiSegment('{{ pname }}', String(params.{{ safePName }})); + params.{{ safePName }} = encodeWithoutSlashes(String(params.{{ safePName }})); + {% else %} + validateSingleSegment('{{ pname }}', String(params.{{ safePName }})); + params.{{ safePName }} = encodeWithSlashes(String(params.{{ safePName }})); + {% endif %} + } + {% endif %} + {% endfor %} + {% endif %} + const rootUrl = options.rootUrl || {{ rootApi.rootUrl|buildurl|safe }}; const parameters = { options: Object.assign({ - url: (rootUrl + {{ ('/' + rootApi.servicePath + m.path)|buildurl|safe }}).replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + {{ ('/' + rootApi.servicePath + m.path)|buildurl|safe }}).replace(/([^:]\/)\/+/g, '$1').replace(/\{([^+:][^}]*)\}/g, '{+$1}'), method: '{{ m.httpMethod }}', apiVersion: '{{ m.apiVersion }}' }, options), params, - {% if m.mediaUpload.protocols.simple.path %}mediaUrl: (rootUrl + {{ ('/' + m.mediaUpload.protocols.simple.path)|buildurl|safe }}).replace(/([^:]\/)\/+/g, '$1'),{% endif %} + {% if m.mediaUpload.protocols.simple.path %}mediaUrl: (rootUrl + {{ ('/' + m.mediaUpload.protocols.simple.path)|buildurl|safe }}).replace(/([^:]\/)\/+/g, '$1').replace(/\{([^+:][^}]*)\}/g, '{+$1}'),{% endif %} requiredParams: [{% if m.parameterOrder.length %}'{{ m.parameterOrder|join("', '")|safe }}'{% endif %}], pathParams: [{% if pathParams.length %}'{{ pathParams|join("', '")|safe }}'{% endif %}], context: this.context, diff --git a/src/index.ts b/src/index.ts index a593828fb3d..1b0c2603878 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,6 +16,7 @@ import {GoogleApis} from './googleapis'; const google = new GoogleApis(); export {google, GoogleApis}; export * as Common from 'googleapis-common'; +export * from './transcoding'; export * as Auth from 'google-auth-library'; export {abusiveexperiencereport_v1} from './apis/abusiveexperiencereport/v1'; diff --git a/src/transcoding.ts b/src/transcoding.ts new file mode 100644 index 00000000000..0beb47e04d0 --- /dev/null +++ b/src/transcoding.ts @@ -0,0 +1,65 @@ +// Copyright 2026 Google LLC +// +// 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. + +// Validates a single path segment matched by a single wildcard (*) or {param}. +// Checks that the segment is not exactly '.' or '..' (directory traversal indicators). +export function validateSingleSegment( + propertyName: string, + value: string +): void { + if (value === '.' || value === '..') { + throw new Error(`Invalid value ${value} for ${propertyName}`); + } +} + +// Validates a multi-segment path matched by a double wildcard (**) or {+param}. +// Splitting by slash, it checks that no individual segment is exactly '.' or '..'. +// This segment-by-segment check prevents directory traversal while allowing +// legitimate resource names containing dots (e.g., domain-scoped project IDs). +export function validateMultiSegment( + propertyName: string, + value: string +): void { + if (value) { + const segments = value.split('/'); + if (segments.some(segment => segment === '.' || segment === '..')) { + throw new Error( + `Value for ${propertyName} must not contain segments that are exactly . or ..` + ); + } + } +} + +// Strictly percent-encodes a character to comply with RFC 3986. +// This is necessary because encodeURIComponent natively encodes URL-unsafe +// characters like ?, #, $, &, +, etc., but preserves !, ', (, ), and *. +// To ensure strict compliance, we manually encode those preserved characters. +export function strictEncodeURIComponent(str: string): string { + return encodeURIComponent(str).replace( + /[!'()*]/g, + character => '%' + character.charCodeAt(0).toString(16).toUpperCase() + ); +} + +export function encodeWithSlashes(str: string): string { + return [...str] + .map(c => (c.match(/[-_.~0-9a-zA-Z]/) ? c : strictEncodeURIComponent(c))) + .join(''); +} + +export function encodeWithoutSlashes(str: string): string { + return [...str] + .map(c => (c.match(/[-_.~0-9a-zA-Z/]/) ? c : strictEncodeURIComponent(c))) + .join(''); +} diff --git a/test/test.path.ts b/test/test.path.ts index d8201868bbc..f60fbf36af2 100644 --- a/test/test.path.ts +++ b/test/test.path.ts @@ -232,6 +232,87 @@ describe('Path params', () => { ); }); + it('should throw an error for single-segment path traversal containing "." or ".."', () => { + assert.throws(() => { + localDrive.files.get({fileId: '.'}, Utils.noop); + }, /Invalid value \. for fileId/); + + assert.throws(() => { + localDrive.files.get({fileId: '..'}, Utils.noop); + }, /Invalid value \.\. for fileId/); + }); + + it('should throw an error for multi-segment path traversal containing "." or ".." segments', () => { + const google = new GoogleApis(); + const dialogflow = google.dialogflow('v3'); + + assert.throws(() => { + dialogflow.projects.locations.agents.sessions.detectIntent( + { + session: + 'projects/p/locations/l/agents/a/sessions/agents/../subagent', + }, + Utils.noop + ); + }, /Value for session must not contain segments that are exactly \. or \.\./); + + assert.throws(() => { + dialogflow.projects.locations.agents.sessions.detectIntent( + { + session: + 'projects/p/locations/l/agents/a/sessions/agents/./subagent', + }, + Utils.noop + ); + }, /Value for session must not contain segments that are exactly \. or \.\./); + }); + + it('should protect against query parameter and fragment injection by percent-encoding in path parameters', done => { + const google = new GoogleApis(); + const dialogflow = google.dialogflow('v3'); + const p = + '/v3/projects/p/locations/l/agents/a/sessions/my-session%3F%24httpMethod%3DDELETE%23:detectIntent'; + + nock('https://dialogflow.googleapis.com').post(p).reply(200, {}); + + dialogflow.projects.locations.agents.sessions.detectIntent( + { + session: + 'projects/p/locations/l/agents/a/sessions/my-session?$httpMethod=DELETE#', + }, + (err: Error | null, res?: GaxiosResponseWithHTTP2 | null) => { + if (err) { + return done(err); + } + assert.ok(res?.config.url?.toString().endsWith(p)); + done(); + } + ); + }); + + it('should strictly percent-encode reserved characters while preserving unreserved characters and slashes in reserved parameters', done => { + const google = new GoogleApis(); + const dialogflow = google.dialogflow('v3'); + const p = + '/v3/projects/p/locations/l/agents/a/sessions/%20%21%40%24%26%27%28%29%2A%2B%2C%3B%3D%3A%25:detectIntent'; + + nock('https://dialogflow.googleapis.com').post(p).reply(200, {}); + + dialogflow.projects.locations.agents.sessions.detectIntent( + { + session: + 'projects/p/locations/l/agents/a/sessions/ !@$&\'()*+,;=:%', + }, + (err: Error | null, res?: GaxiosResponseWithHTTP2 | null) => { + if (err) { + return done(err); + } + assert.ok(res?.config.url?.toString().endsWith(p)); + done(); + } + ); + }); + after(() => { nock.cleanAll(); });